#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 1, kol = 0;
  cin >> n;
  if (n == 1) {
    cout << '1';
  } else {
    while (n > 1) {
      kol += 4;
      sum += kol;
      n--;
    }
    cout << sum;
  }
}
