using System;class E{static void Main(){for(;;)Console.Write(Math.Sqrt(8*Convert.ToByte(Console.ReadLine(),2)+1)%2==1?1:0);}}