Totient by inaniwa

r;n;main(i,s){for(;gets(s);printf("%d\n",r-r/n?:r))for(r=n=atoi(),i=2;n%i?n/i++/i:(n/=i)%i?r-=r/i:1;);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page