#include using namespace std; long sumOfGroup(int k) { // Return the sum of the elements of the k'th group. long long start = 1; for(int i = 1; i < k; ++i){ start += i + i; } int nw = 2; long long ans = start * k; for(int i = 2; i <= k; ++i){ ans += nw; nw += 2; } return ans; } int main() { int k; cin >> k; long long answer = sumOfGroup(k); cout << answer << endl; return 0; }