#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int t = 2 * (n - 1) + 1;
  int s = (((t - 1) / 2) + 1);
  int e = ((s * (1 + t)) / 2) - t;
  cout << 2 * e + t;
  return 0;
}
