#include <bits/stdc++.h>
using namespace std;
const int c1 = 1e9 + 7;
const int c2 = 1e9 + 9;
const long long bs = (long long)239;
const long long C = 1e9;
int main() {
  int x;
  cin >> x;
  int s = 1;
  for (int i = 1; i < x; ++i) s += 4 * i;
  cout << s;
  return 0;
}
