/*
give you a square with a side length of N, cut into a small cube of n*n*n units, and ask for the logarithm of the small cube of all public vertex numbers <=2.
the number of public points may be: 0,1,2,4.
We can subtract the logarithm of four common points with the total logarithm.
Total logarithm: n^3* (n^3-1)/2 (altogether have n^3 block small square, from which to choose 2 pieces)
and 4 intersection of the cube pair is two cube coplanar situation,
so we only ask for a large cube a total of how many units area of the common surface on it,
both the number of faces of all unit cubes 6*n^3 minus the number of polygons on the large cube surface 6*n^2,
so the result is: N^3 * (n^3-1)/2-3*n^2 (n-1) * *
include <stdio.h >
# include <algorithm>
# include <string.h>
using namespace std;
int main ()
{
int n;
while (~SCANF ("%d", &n))
{
printf ("%d\n", (n*n*n* (n*n*n-1))/2-3*n*n* (n-1));
}
return 0;
}