#include <bits/stdc++.h>
using namespace std;
long long int solve(int n) {
  if (n == 1) return 1;
  return solve(n - 1) + ((n - 1) * 4);
}
int main() {
  int n;
  cin >> n;
  cout << solve(n);
  return 0;
}
