#include <bits/stdc++.h>
using namespace std;
int func(int n) {
  if (n == 1) return 1;
  int ans = 0;
  int x = (2 * n) - 3;
  while (x > 0) {
    ans += x;
    x -= 2;
  }
  return (2 * ans) + 2 * n - 1;
}
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  cout << func(n);
  return 0;
}
