using C=System.Console;class F{static void Main(){var s=C.ReadLine();C.WriteLine(s[0]!=86|s[1]!=79?"PHONY":3+s.Length+"");Main();}}