from scipy.special import zeta x=int(input()) MAX = pow(10,5) ans = 0 for n in range(x,MAX): temp = zeta(n)*pow(10,6) - pow(10,6) #temp *= pow(10,6) ans += temp ans = int(ans) print(ans)