#include<iostream>
#include<cmath>
using namespace std;
const double eps = 1.0e-9;
int main()
{
  while(true){
    unsigned long long int n,r,ans=0;
    cin >> n;
    if( n == 0 )break;
    unsigned long long int tmp = n/2LL;
    unsigned long long int rn = (long long int)ceil(sqrt(n/2)-eps);
    //cout << " RN : " << rn << endl;
    for(unsigned long long int i = 2; i <=rn; ++i){
      if(n%(2*(i-1))==0)tmp+=n/(2*(i-1));
      else tmp+=n/(2*(i-1))+1;
    }
    tmp *= 2;
    tmp -= rn*rn;
    ans = 8*(n+tmp);
    cout << ans << endl;
  }
  return 0;
}