import java.io.IOException; import java.io.InputStream; import java.util.Arrays; import java.util.NoSuchElementException; public class Main { public static void main(String[] args) { new Main().run(); } int good(int pos, char[] cs) { int INF=Integer.MAX_VALUE/3; int ret=0; if (pos+4>cs.length) return INF; char[] target= {'g','o','o','d'}; for (int i=pos;ics.length) return INF; char[] target= {'p','r','o','b','l','e','m'}; for (int i=pos;i=0;--i) { dp2[i]=Math.min(i+1==n?INF:dp2[i+1],problem(i,cs)); } for (int i=0;i Integer.MAX_VALUE) throw new NumberFormatException(); return (int) nl; } public double nextDouble() { return Double.parseDouble(next());} }