using C=System.Console;class X{static void Main(){C.Write(29*C.Read()/5%9);}}