#include <iostream>
using namespace std;
int main() {
int x;
cin >> x ;
cout << (x*x*4)-(3*x)+5;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKCWludCB4OwogICAgY2luID4+IHggICAgIDsKICAgIGNvdXQgPDwgKHgqeCo0KS0oMyp4KSs1OwoJcmV0dXJuIDA7Cn0=