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