#include <iostream>#include <cmath>using namespace std ;int main(int argc, char** argv) { int n,i,sum; while(cin>>n){ if(n==0) break; sum=0; for(i=1; i<=n; i++) sum=sum+(pow(i,2)+0.0000000001); cout<<sum<<endl; } return 0;}