using C=System.Console;class M{static void Main(){var s=C.ReadLine();C.WriteLine(s[3]-s[2]==3?s.Length+3+"":"PHONY");Main();}}