#include <iostream>
using namespace std;
int main() {
// your code goes here
int y, x;
cin>> x;
x<5? y=(x*x)-3*x+4:y=x+7;
cout <<y;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CgkvLyB5b3VyIGNvZGUgZ29lcyBoZXJlCglpbnQgeSwgeDsKCWNpbj4+IHg7Cgl4PDU/IHk9KHgqeCktMyp4KzQ6eT14Kzc7Cgljb3V0IDw8eTsKCXJldHVybiAwOwp9