#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  int a = 1, x;
  for (int i = 1; i <= n; i++) {
    cnt += a;
    if (i == n) x = a;
    a += 2;
  }
  cout << cnt * 2 - x << endl;
  return 0;
}
