#include<bits/stdc++.h>
using namespace std;
double x;
double f(int x){
if(x>=0.0&&x<5.0) return (0.0-x)+2.5;
else if(x>=5.0&&x<10.0) return 2.0-1.5*(x-3)*(x-3);
else if(x>=10.0&&x<20.0) return x/2.0-1.5;
}
int main(){
scanf("%lf",&x);
printf("%.3lf",f(x));
return 0;
}