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