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