#include <iostream>
#include<iomanip>
using namespace std;
int main() {
int withdraw;
float amount;
cin>>withdraw>>amount;
if(withdraw%5==0)
{
if(withdraw+0.5<=amount&&withdraw!=0)
cout<<fixed<<setprecision(2)<<amount-withdraw-0.5;
else
cout<<fixed<<setprecision(2)<<amount;
}
else
cout<<fixed<<setprecision(2)<<amount;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZTxpb21hbmlwPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7IAoJCmludCB3aXRoZHJhdzsgCmZsb2F0IGFtb3VudDsKY2luPj53aXRoZHJhdz4+YW1vdW50OwoKaWYod2l0aGRyYXclNT09MCkKewogaWYod2l0aGRyYXcrMC41PD1hbW91bnQmJndpdGhkcmF3IT0wKSAKIGNvdXQ8PGZpeGVkPDxzZXRwcmVjaXNpb24oMik8PGFtb3VudC13aXRoZHJhdy0wLjU7CmVsc2UgCmNvdXQ8PGZpeGVkPDxzZXRwcmVjaXNpb24oMik8PGFtb3VudDsgCn0KZWxzZQogY291dDw8Zml4ZWQ8PHNldHByZWNpc2lvbigyKTw8YW1vdW50OwpyZXR1cm4gMDsKfQ==