#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

template<class T>
using minheap = priority_queue<T, vector<T>, greater<T>>;

#define allof(x) x.begin(), x.end()

const int MAXN = 9;
const int MAXA = 5;
const int MAX_ROOM = 1953125;
const int HALF = 4;

int N;

int main(){
    cin.tie(0);
    cin.sync_with_stdio(0);

    ll K;
    cin >> K;
    ll start = K * (K - 1) / 2;
    ll sum = 0;
    for(ll a = 0; a < K; a++){
        sum += (start + a) * 2 + 1;
    }
    cout << sum;
}