#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T smax(T& a, const T& b) {
  return a < b ? a = b, b : a;
}
template <typename T>
inline T smin(T& a, const T& b) {
  return a > b ? a = b, b : a;
}
const int INF = 0x3f3f3f3f;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2")
int32_t main() {
  int n;
  cin >> n;
  int res = 1;
  int a = 0;
  while (n--) {
    res += a;
    a += 4;
  }
  cout << res << "\n";
  return 0;
}
