def e(n): n,t=s(n,2,1) p=3 while n>=p*p: if n%p<1:n,t=s(n,p,t) p+=2 print t*(n-1)if n>1 else t def s(n,p,t): c=1 while n%p<1:n//=p;t*=p-c;c=0 return n,t while 1: try:e(input()) except:break