#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, n, m, ans = 4, sum = 1, temp;
  cin >> n;
  if (n == 1) {
    cout << "1" << endl;
    return 0;
  } else {
    for (i = 1; i < n; i++) {
      sum = sum + ans;
      ans = ans + 4;
    }
  }
  cout << sum << endl;
}
