#include <bits/stdc++.h>
int main() {
  int n, i, sum = 0, j = 1;
  scanf("%d", &n);
  for (i = 1; i <= n; i++, j = j + 2) {
    sum = sum + j;
  }
  j = 1;
  for (i = 1; i < n; i++, j = j + 2) {
    sum = sum + j;
  }
  printf("%d\n", sum);
}
