#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, pl = 4, otv = 1;
  cin >> n;
  if (n > 1) {
    for (long long i = 1; i < n; i++) {
      otv = otv + pl;
      pl += 4;
    }
  } else if (n == 1) {
    otv = 1;
  }
  cout << otv;
}
