#include <bits/stdc++.h>
using namespace std;
const long long MXN = 2e5 + 1;
const long long MAXN = 1e2 + 1;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
long long dp[MXN], n;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  long long cnt = 4;
  dp[1] = 1;
  for (int i = 2; i <= 100; i++) {
    dp[i] = dp[i - 1] + cnt;
    cnt += 4;
  }
  cout << dp[n];
  return 0;
}
