#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n;
  if (n == 1)
    cout << "1";
  else {
    k = 1;
    for (int i = 2; i <= n; i++) k = k + 4 * (i - 1);
    cout << k;
  }
  return 0;
}
