using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Takmicenje_4
{
    class Program
    {
        static void Main(string[] args)
        {
            int i, br = 0;
            string n;
            n = Console.ReadLine();
            for (i = 0; i < n.Length - 1; i++)
            {
                if (n[i] == n[i + 1])
                    br++;
            }
            if (br != 0)
                Console.WriteLine("0");
            else
            {
                Console.WriteLine("1");
            }
            Console.ReadLine();
        }
    }
}