#include <bits/stdc++.h>
using namespace std;
long long power(long long a, long long b) {
  long long res;
  if (b == 0) return 1;
  if (b == 1) return a % 1000000007;
  if (b & 1) {
    res = power(a, b - 1) % 1000000007;
    res = ((a % 1000000007) * (res % 1000000007)) % 1000000007;
  } else {
    res = power(a, b / 2) % 1000000007;
    res = ((res % 1000000007) * (res % 1000000007)) % 1000000007;
  }
  return res;
}
void solve() {
  long long a[105] = {0}, i;
  a[1] = 1;
  for (i = 2; i <= 100; i++) {
    a[i] = a[i - 1] + (i - 1) * 4;
  }
  long long n;
  cin >> n;
  cout << a[n] << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
