import math x=int(input()) if x==2: print(999999) exit(0) ans=0 for i in range(2,1000000000000): if pow(i,x-1)*(i-1)>10000000000000000: break A=pow(i,x-1)*(i-1) ans+=1000000/A print(math.floor(ans))