import java.util.Scanner;
class Bank {
public static void main(String arr[]){
Scanner meo = new Scanner(System.in);
int withdraw=0;float balance=0;
withdraw=meo.nextInt();
balance=meo.nextFloat();
if((withdraw+.5>balance)||(withdraw%5!=0))
System.out.printf("d",balance);
else
System.out.printf(".2f",balance-withdraw-.50);
}}