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