int main() { int x=0,y; scanf("%d",&x); if(x<0) y=-x; else if(x<5) y=2*x+1; else y=5*x-1; printf("y=%d\n",y); return 0; }