N=int(input()) ANS=0 for i in range(N+1): if i%3==0: ANS+=i*i*i elif i%3==1: ANS+=i else: ANS+=i*i print(ANS)