#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 1e6 + 10;
long long a[maxn];

int main() {
a[3] = 0;
for (long long x = 4; x <= maxn; x++) {
a[x] = a[x-1] + ((x-1)*(x-2)/2 - (x-1)/2)/2;
}
int n;
while (~scanf("%d", &n)) {
if (n < 3) break;
cout << a[n] << endl;
}
return 0;
}