#include <bits/stdc++.h> using namespace std; double f(double x){ if(0<=x<5) return 0-x+2.5; if(5<=x<10) return 2-1.5*(x-3)*(x-3); if(10<=x<20) return x/2-1.5; } int main(){ double y; cin>>y; cout<<fixed<<setprecision(3)<<f(y)<<endl; return 0; }