x=float(input()) y=float(input()) if x>y: print(format(y,\'.2f\')) elif x%5!=0: print(format(y,\'.2f\')) else: balance=y-(x+0.5) print(format(bala