//qf
#include <bits/stdc++.h>
#define f(i,j,n) for(register int i=j;i<=n;i++)
using namespace std;
typedef long long ll;
inline ll read() {
ll x=0;
int f=1;
char ch=getchar();
while(!isdigit(ch)) {
if(ch=='-') f=-1;
ch=getchar();
}
while(isdigit(ch)) x=(x<<1)+(x<<3)+(ch-48),ch=getchar();
return x*f;
}
signed main() {
double x,y;
cin>>x;
if(0<=x and x<5) y=-x+2.5;
else if(5<=x and x<10) y=2-1.5*(x-3)*(x-3);
else y=x/2-1.5;
cout<<fixed<<setprecision(3)<<y<<endl;
return 0;
}