epsi = 0.0001
term = 1
sum = 1
def fact (n):
prod = 1
if n == 0:
return 1
else:
for i in range (n):
prod *= (i+1)
return prod
x = float(input())
k = 1
while term > epsi:
term = (x**k)/fact(k)
sum += term
k += 1
print sum
ZXBzaSA9IDAuMDAwMQp0ZXJtID0gMQpzdW0gPSAxCmRlZiBmYWN0IChuKToKICAgcHJvZCA9IDEKICAgaWYgbiA9PSAwOgogICAgICByZXR1cm4gMQogICBlbHNlOgogICAgICBmb3IgaSBpbiByYW5nZSAobik6CiAgICAgICAgIHByb2QgKj0gKGkrMSkKICAgICAgcmV0dXJuIHByb2QKeCA9IGZsb2F0KGlucHV0KCkpCmsgPSAxCndoaWxlIHRlcm0gPiBlcHNpOgogICB0ZXJtID0gKHgqKmspL2ZhY3QoaykKICAgc3VtICs9IHRlcm0KICAgayArPSAxCnByaW50IHN1bQ==