import sys from math import floor sys.setrecursionlimit(10 ** 7) input = sys.stdin.readline f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): def f(n, k): res = 0 for i in range(1, k): res += 1 / p[i][n - x] return res x = int(input()) p = [[1] * 1010 for _ in range(1010)] for i in range(1, 1010): p[i][0] = pow(i, x) for j in range(1, 1010): p[i][j] = p[i][j - 1] * i res = 0 for i in range(x, x + 1000): res += f(i, 1000) - 1 print(floor(res * 10 ** 6)) if __name__ == '__main__': resolve()