from math import factorial n = int(input('Enter n: ')) print(sum(1/factorial(k) for k in range(n)))