#include <bits/stdc++.h>
using namespace std;
long long ma = 1000000007;
long long power(long long p, long long t) {
  if (t == 0) return 1;
  long long y = power(p, t / 2);
  y = (y * y) % ma;
  if (t % 2 == 1) y = (y * p) % ma;
  return y;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n == 2) {
    cout << 5 << endl;
    return 0;
  }
  int dp[n];
  dp[0] = 1;
  dp[1] = 5;
  for (int i = 2; i < n; i++) {
    dp[i] = (i)*4 + dp[i - 1];
  }
  cout << dp[n - 1] << endl;
}
