#include<stdio.h>
int main()
{
int x;
float t,i;
scanf("%d %f",&x,&i);
if(x<i)
{
if(x%5==0)
{
t=((i-x)-0.50);
printf("%.2f\n",t);
}
else
printf("%.2f\n",i);
}
else
printf("%.2f\n",i);
return 0;
}
I2luY2x1ZGU8c3RkaW8uaD4KCmludCBtYWluKCkKewppbnQgeDsKZmxvYXQgdCxpOwpzY2FuZigiJWQgJWYiLCZ4LCZpKTsKaWYoeDxpKQp7CiAgICBpZih4JTU9PTApCiAgICB7CiAgICB0PSgoaS14KS0wLjUwKTsKICAgIHByaW50ZigiJS4yZlxuIix0KTsKICAgIH0KICAgIGVsc2UKICAgIHByaW50ZigiJS4yZlxuIixpKTsKfQplbHNlCnByaW50ZigiJS4yZlxuIixpKTsKcmV0dXJuIDA7Cn0=