#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  if (n == 1)
    cout << 1 << endl;
  else if (n == 2)
    cout << 5 << endl;
  else
    cout << (((n * (n + 1)) >> 1) + (n * (n - 1)) + (((n - 1) * (n - 2)) >> 1))
         << endl;
}
