n = int(input()) total = 0 k_max = (n + 2) // 3 for k in range(1, k_max + 1): a = 3 * k - 2 total += a b = 3 * k - 1 if b <= n: total += b * b c = 3 * k if c <= n: total += c * c * c print(total)