C, Y = map(int, input().split()) n100 = Y % 500 // 100 if n100 >= C: print("no exchange") elif Y >= C * 100: req = C - n100 print(n100 + (req + 4) // 5 * 5) else: print("can't exchange")