#include <bits/stdc++.h>
using namespace std;
long long int findAns(long long int n) {
  if (n == 1) return 1;
  long long int ans = 1;
  long long int count = 1;
  while (n >= 2) {
    ans = ans + 4 * count;
    count++;
    n--;
  }
  return ans;
}
int main() {
  int n;
  cin >> n;
  cout << findAns(n) << endl;
  return 0;
}
