from math import pi, floor def zeta_m1(n): if n == 2: return pi*pi/6 - 1.0 elif n == 3: return 0.202056903159594 elif n == 4: return pi**4/90 - 1.0 res = 0 for i in range(2, 1000): denom = i ** n if denom > 1e12: break res += 1 / denom return res X = int(input()) if X == 2: print(1000000) exit() ans = 0 for i in range(X, 20000): ans += zeta_m1(i) print(int(floor(ans*1000000)))