#include <bits/stdc++.h>
using namespace std;
const int LIM = 1e6;
int main() {
  int n;
  cin >> n;
  long long res = 1;
  for (int i = 0; i < n; ++i) {
    res += i * 4;
  }
  cout << res;
  return 0;
}
