#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long dp[101];
  dp[1] = 1;
  for (long long n = 2; n <= 100; n++) dp[n] = 4 * (n - 2) + 4 + dp[n - 1];
  long long N;
  cin >> N;
  cout << dp[N] << endl;
  return 0;
}
