#include<bits/stdc++.h>
using namespace std;
int main()
{
char x,y;
cin>>x;
if (x<=150){
y==x*0.4463;
printf("%1f",y);}
if(x>150&&x<=400){
y==150*0.4463+(x-150)*0.4663;
printf("%1f",y);}
if(x>400){
y==150*0.4463+(x-150)*0.4663+(x-400)*0.5663;
printf("%1f",y);}
return 0;
}