d;main(n,s){for(;~scanf("%d%s",&n,s);printf("%d\n",d))for(d=1;n>0;n-=strlen(s))d*=n;}