#include using namespace std; int main() { int k; cin >> k; long long ans = 2LL*(2LL*k+1LL)*k - (k-1)*2LL; cout << ans << "\n"; return 0; }