def one(n): k=n//3 return 3*k*(k+1)//2-2*k def two(n): k=n//3 return 3*k*(k+1)*(2*k+1)//2-3*k*(k+1)+k def three(n): k=n//3 return 27*(k*(k+1)//2)**2 N=int(input()) res=0 for i in range(1,N+1): if i%3==1: res+=i elif i%3==2: res+=i*i else: res+=i*i*i print(res)