x[];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++]?s:s?-1:j;j=!printf("%d",s?s:-1);}