#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = 2 * n - 1;
  for (int i = 1; i < 2 * n - 1; i += 2) {
    ans += 2 * i;
  }
  cout << ans << "\n";
  return 0;
}
