#include <bits/stdc++.h>
using namespace std;
long long int bypass_pow(long long int a, long long int b) {
  long long int x = 1;
  a = a % (long long int)(1000000007);
  while (b > 0) {
    if (b % 2 == 1) x = (x * a) % (long long int)(1000000007);
    b /= 2;
    a = (a * a) % (long long int)(1000000007);
  }
  return x;
}
void solve(long long int n) {
  long long int t = bypass_pow((long long int)2, n);
  cout << (5 * t) % (long long int)(1000000007) << endl;
  return;
}
int main() {
  long long int n;
  cin >> n;
  long long int a = 1, ans = 1;
  if (n == 1)
    cout << n << endl;
  else {
    while (a != n) {
      ans += 4 * a;
      a++;
    }
    cout << ans << endl;
  }
  return 0;
}
