char x[31];a[100],i,j,s;main(n){for(scanf("%d",&n);~scanf("%s",x);a[i++%n]+=!strcmp(x,"nyanpass"));for(;j<100;)s=a[j++]+1-n?s:s?-1:i;j=!printf("%d",s?s:-1);}