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