using System; class E{static void Main(){ int[] A=new int[] {0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253}; int g=Convert.ToInt32(Console.ReadLine(),2); Console.Write(Array.IndexOf(A,g)?1:0); }}