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