import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
class atm {
String[] inp
=br.
readLine().
split(" ");; double x
=Double.
parseDouble(inp
[0]); double y
=Double.
parseDouble(inp
[1]);
if((x<y+0.5)&&(x%5==0))
y=y-x-0.5;
System.
out.
printf("%.2f\n",y
); }
}
aW1wb3J0IGphdmEuaW8uQnVmZmVyZWRSZWFkZXI7CmltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOwppbXBvcnQgamF2YS5pby5JbnB1dFN0cmVhbVJlYWRlcjsKCmNsYXNzIGF0bSB7CgogICAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgdGhyb3dzIEV4Y2VwdGlvbiB7CiAgICAgICAgQnVmZmVyZWRSZWFkZXIgYnI9bmV3IEJ1ZmZlcmVkUmVhZGVyKG5ldyBJbnB1dFN0cmVhbVJlYWRlcihTeXN0ZW0uaW4pKTsKICAgICAgICBTdHJpbmdbXSBpbnA9YnIucmVhZExpbmUoKS5zcGxpdCgiICIpOzsKICAgICAgICBkb3VibGUgeD1Eb3VibGUucGFyc2VEb3VibGUoaW5wWzBdKTsKICAgICAgICBkb3VibGUgeT1Eb3VibGUucGFyc2VEb3VibGUoaW5wWzFdKTsKCiAgICAgICAgaWYoKHg8eSswLjUpJiYoeCU1PT0wKSkKICAgICAgICAgICAgeT15LXgtMC41OwoKICAgICAgICAgICAgU3lzdGVtLm91dC5wcmludGYoIiUuMmZcbiIseSk7CiAgICAgICAgfQogICAgfQo=