result = 0 c = 1 for i in reversed(range(len(input()))): c *= (i+1) result += c print(result)