#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using DAUN = int;
using KostyaSavchuk = DAUN;
KostyaSavchuk n;
KostyaSavchuk solve(KostyaSavchuk n) {
  KostyaSavchuk res = 1;
  KostyaSavchuk bounds = 4;
  for (KostyaSavchuk i = 1; i < n; ++i) {
    res += bounds;
    bounds += 4;
  }
  return res;
}
int main() {
  cin >> n;
  cout << solve(n) << endl;
  return 0;
}
