import math
n = int(input())
an = [math.factorial(i) for i in range (1,1+n)]
print(sum(list(an)))