#include <bits/stdc++.h>
using namespace std;
void solve() {
  int x, s = 1;
  cin >> x;
  for (int i = 1; i <= x; i++) {
    int y = (i - 1) * 4;
    s = s + y;
  }
  cout << s << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
