using System;

namespace ConsoleApp12
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            if (RazliciteCifre(s))
            {
                Console.WriteLine('1');
            }
        }
        
        static bool RazliciteCifre(string s)
        {
            bool asd = false;
            for (int i = 0; i < s.Length - 1; i++)
            {
                if (s[i] != s[i + 1])
                {
                    asd = true;
                }
                else
                {
                    asd = false;
                    break;
                }
            }
            return asd;
        }
    }
}