#include <bits/stdc++.h>
using namespace std;
int dp[101];
void cal() {
  dp[0] = 0;
  dp[1] = 1;
  int j = 1;
  for (int i = 2; i <= 100; i++) {
    dp[i] = dp[i - 1] + (4 * j);
    j++;
  }
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(NULL);
  std::cout.tie(NULL);
  cal();
  int n;
  cin >> n;
  cout << dp[n] << "\n";
  return 0;
}
