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