Console.Write((int)Math.Sqrt(1+8*Convert.ToByte(Console.ReadLine(),2))%1>0))