#include<bits/stdc++.h> using namespace std; double x,y; int main(){ cin>>x; if(0<=x&&x<5) y=-x+2.5; if(5<=x&&x<10) 2-1.5*(x- 3)*(x - 3); if(10<=x&&x<20) y=x/2-1.5; printf("%.3lf",y); return 0; }