#24645: C++AC


rayhsu1216 (108-34許洋睿)


 

long long b,s;

while(cin>>b){

s=0;

if(b==0)break;

for(int i=1;i<=b;i++)s+=i*i;

cout<<s<<endl