using C=System.Console;class X{static void Main(){for(;;)C.Write(C.ReadLine().Split('4')[0]+"1\n");}}