using System; using System.Collections.Generic; using System.Linq; static class Ponponpain { static void Main() { var s = Console.ReadLine(); var endIndex = s.IndexOf("ponpain"); if(endIndex <= 0) Console.WriteLine(-1); else Console.WriteLine(s.Substring(0, endIndex).Split('p').Where(x => x.StartsWith("on")).Count()); } }