#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int dp[101], i;
  dp[0] = 1;
  for (i = 1; i <= 100; i++) {
    dp[i] = dp[i - 1] + (i - 1) * 4;
  }
  int n;
  scanf("%d", &n);
  printf("%lld\n", dp[n]);
}
