#include #include #include #include #include #include #include long int sumOfGroup(int w) { // Return the sum of the elements of the k'th group. long int k=w; k=k-1; long int x=k*(k+1)/2; x=x+1; x=2*x-1; k=k+1; return (k*x+k*(k-1)); } int main() { int k; scanf("%i", &k); long int answer = sumOfGroup(k); printf("%ld\n", answer); return 0; }