#include using namespace std; typedef long long ll; typedef pair pii; typedef pair pll; typedef pair pdd; template using minheap = priority_queue, greater>; #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; }