N = int(input()) ans = 0 j = 1 for i in range(1, N + 1): ans += i ** j j += 1 if j == 4: j = 1 print(ans)