#include using namespace std; int main() { unsigned long long k; cin >> k; if (k == 1) { cout << 6 << endl; } else { unsigned long long ans = ((2 * k + 1) * (2 * k + 1) + 1) / 2 + ((2 * k - 1) * (2 * k - 1) + 1) / 2; cout << ans << endl; } return 0; }