#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n;
  cin >> n;
  if (n == 1)
    cout << 1 << "\n";
  else
    cout << (2 * n - 1) * (2 * n - 1) - 2 * (n) * (n - 1) << "\n";
  return 0;
}
