#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> boxes(n + 1);
  boxes[1] = 1;
  for (int i = 2; i <= n; i++) boxes[i] = boxes[i - 1] + 4 * (i - 1);
  cout << boxes[n];
  return 0;
}
