N = int(input()) sum = 0 for i in range(1,(N//3)+1,1): sum += 3*i-2 sum += (3*i-1)*(3*i-1) sum += (3*i)*(3*i)*(3*i) else: if N%3 == 0: pass elif N%3 == 1: sum += N else: sum += N-1 sum += N*N print(sum)