/** * @FileName a.cpp * @Author kanpurin * @Created 2021.05.01 03:55:34 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { ll k;cin >> k; cout << (2*k+1)*(2*k+1)/2+1+(2*k-1)*(2*k-1)/2+1 << endl; return 0; }