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