#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  a[0] = 1;
  a[1] = 5;
  a[2] = 13;
  a[3] = 25;
  for (int i = 4; i < n; i++) {
    a[i] = a[i - 1] + 4 * (i);
  }
  cout << a[n - 1] << endl;
  return 0;
}
