#include
#include<bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
float in;
int amount;
cin >> amount>> in;
if((in>=0&&in<=2000)&&(amount>0&&amount<=2000))
{
if(amount%5!=0 || amount>in)
{
cout<<fixed<<setprecision(2)<<in;}
else{
cout<<fixed<<setprecision(2)<<((in-amount)-0.50 );
}
}
return 0;
}