#include <stdio.h>
#include <stdlib.h>
#include <math.h>

/* typedef */

typedef unsigned long long ull_t;

/* main */

int main(int argc, char **argv) {
  ull_t n, hn, count, x, cn;
  double hnf;

  for (;;) {
    scanf("%llu", &n);
    if (n == 0) break;

    hn = n / 2;

    count = hn;
    for (x = 1; x * x < hn; x++)
      count += (hn + x - 1) / x;

    cn = 0;
    while (cn * cn < hn) cn++;

    printf("%llu\n", 2 * (8 * count - 4 * cn * cn) + 8 * n);
  }

  return 0;
}