n = int(input()) i = 1 kaisuu = 1 kakerukazu = 1 ans = 0 while i <= n: for ipp in range(kaisuu): ans += i ** kakerukazu if kakerukazu < 3: kakerukazu += 1 else: kakerukazu = 1 i += 1 print(ans)