#include #define rep(i, n) for (int i = 0; i < n; ++i) typedef long long ll; using namespace std; int main() { ll K; cin >> K; cout << (4LL * K * K) + 2LL << endl; return 0; }