var s:string;n,m:comp;begin repeat read(n,s);m:=1;repeat m:=m*n;n:=n-length(s)until n<2;writeln(m)until 1=0end.