#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  long long ans[n];
  ans[0] = 1;
  for (long long i = 1; i < n; i++) {
    ans[i] = ans[i - 1] + 4 * i;
  }
  cout << ans[n - 1];
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
