#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long N = 1 + (n - 1) * 2;
  long long cells = ((N / 2) * (2 + (N / 2 - 1) * 2) + N);
  cout << cells << "\n";
  return 0;
}
