#include
#include
using namespace std;
int main()
{
double n,a,b,c;
cout<<setiosflags(ios::fixed)<<setprecision(1);
cin>>n;
if(n<=150)
cout<<n*0.4463;
if(150<=n<=400)
cout<<150*0.4463+(n-150)*0.4663;
if(n>400)
cout<<150*0.4463+250*0.4663+(n-400)*0.5663;
}