K = int(input())
coin = 0
i = 1
current = 0
# 先按每组天数刚好占满的情况算总金币
while current <= K:
    current += i
    coin += i*i
    i += 1
# 减去超出的天数的金币
coin -= (current-K)*(i-1)
print(coin)