n=int(input()) P=[] i=1 while i*i<=n: if n%i==0: P+=[i,n//i] i+=1 P=sorted(set(P)) q=[0]*(n+1) for i in range(2,n+1): if n%i==0: p=[] c=[] for j in range(len(P)): if P[j]<=i: if i%P[j]==0: p+=[P[j]] c+=[i//P[j]] else: break for ii in reversed(range(len(p))): for jj in range(ii+1,len(p)): if p[jj]%p[ii]==0: c[ii]-=c[jj] q[i]=(sum(c[ii]*q[p[ii]] for ii in range(len(p)-1))+i)/(i-c[len(p)-1]) print(q[n])