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