#include <iostream>
using namespace std ;
int main (void)
{
float X,Y, Z; // amount to be withdrawn ,available balance and amount after transaction
cin>> X>> Y;
if ((((int)X % 5) !=0 ) || (X > 2000)) // wrong entry or insufficient funds
cout<<Y<<endl;
else
if(X> Y)
cout<<Y<<endl;
else
{
Z=(Y-(X+0.5));
cout<< Z;//display balance after transaction
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkIDsKCmludCBtYWluICh2b2lkKQogICAgewoKICAgICAgICBmbG9hdCBYLFksIFo7IC8vIGFtb3VudCB0byBiZSB3aXRoZHJhd24gLGF2YWlsYWJsZSBiYWxhbmNlIGFuZCBhbW91bnQgYWZ0ZXIgdHJhbnNhY3Rpb24KCiAgICAgICAgY2luPj4gWD4+IFk7CgogICAgICAgIGlmICgoKChpbnQpWCAlIDUpICE9MCApIHx8IChYID4gMjAwMCkpIC8vIHdyb25nIGVudHJ5IG9yIGluc3VmZmljaWVudCBmdW5kcwoKICAgICAgICAgICAgICAgIGNvdXQ8PFk8PGVuZGw7CgogICAgICAgIGVsc2UKICAgICAgICAgICAgaWYoWD4gWSkKCiAgICAgICAgICAgIGNvdXQ8PFk8PGVuZGw7CgogICAgICAgIGVsc2UKICAgICAgICAgICAgewogICAgICAgICAgICBaPShZLShYKzAuNSkpOwogICAgICAgICAgICBjb3V0PDwgWjsvL2Rpc3BsYXkgYmFsYW5jZSBhZnRlciB0cmFuc2FjdGlvbgogICAgICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CgogICAgfQ==