#include<stdio.h>
void main()
{
int a;
float totalmoney;
scanf("%d %f",&a,&totalmoney);
if(a<=2000 && totalmoney<=2000)
{
if(a%5==0)
{
if((a + .50)<=totalmoney)
{
totalmoney=totalmoney-(a+.50);
}
printf(".2f",totalmoney);
}
else
printf(".2f",totalmoney);
}
}