#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  int res = 0;
  for (int i = 1; i < (n * 2) - 1; i += 2) {
    res += i;
  }
  cout << (res * 2) + ((n * 2) - 1) << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
