

#include<stdio.h>
int main()
{
int x,y,z,sum,b,n;
double price,first,second,three;
scanf("%d %d",&x,&y);
b=x;n=y;
sum=x+y;
if(sum<=2760){
price=0.538*y;
printf("%.2f",price);
}
else if(2760<sum&&sum<=4800){
if(x<=2760)
{
z=2760-x;
b=y-z;
first=0.538*z;
second=0.588*b;
price=first+second;
printf("%.2f",price);
}
else{
price=y*0.588;
printf("%.2f",price);
}
}
else if(sum>4800)
{
if(x<=2760){
b=2760-x;
first=0.538*b;
second=0.588*2040;
z=y-4800;
three=z*0.838;
price=first+second+three;
printf("%.2f",price);
}
else if(x>2760&&x<=4800){
b=4800-x;
first=0.588*b;
z=y-b;
second=0.838*z;
price=first+second;
printf("%.2f",price);
}
else if(x>4800)
{
first=y*0.838;
printf("%.2f",first);
}
}
}