#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1;
    return 0;
  }
  n *= 2;
  n--;
  int c = n;
  int s = n;
  c -= 2;
  while (c > 1) {
    s += c * 2;
    c -= 2;
  }
  s += 2;
  cout << s;
}
