#include using std::cin; using std::cout; using std::endl; using ll = long long; int main(){ ll K; cin >> K; ll ans = (2*K+1)*(2*K+1)/2 + (2*K-1)*(2*K-1)/2 + 2; cout << ans << endl; }