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