#include <stdio.h> int main() { float x,y; scanf("%f",&x); if(x>9) y = -1; else if(x>3) y = x*(x+2); else if(x>-1) y = 2*x; else y = x-1; printf("%f",y); return 0; }