#include using namespace std; long sumOfGroup(long k) { // Return the sum of the elements of the k'th group. // n(n+1)/2 long n = k-1; cerr << "n = " << n << endl; // x is starting index long x = n * (n+1) / 2; cerr << "x = " << x << endl; long start = x * 2 + 1; cerr << "start = " << start << endl; long count = k * (k-1) / 2; cerr << "count = " << count << endl; long total = start * k + k*(k-1); return total; } int main() { int k; cin >> k; long answer = sumOfGroup(k); cout << answer << endl; return 0; }