k = int(input()) s = 0 i = 0 while s <= k: i += 1 s += i s2 = 0 for x in range(1,i): s2 = s2 + x**2 S = s2 + (k+1-i)*i print(S)