def exchange(C, Y): coins = [0]*10 currency = [1, 5, 10, 50, 100, 500, 1000, 2000, 5000, 10000] for i in range(9, -1, -1): coins[i] = Y // currency[i] Y %= currency[i] if coins[4] >= C: return "no exchange" for i in range(5, 10): while coins[i] > 0 and coins[4] < C: coins[i] -= 1 coins[4] += 5 coins[5] += 1 if coins[4] >= C: return coins[4] else: return "can't exchange" C, Y = map(int, input().split()) print(exchange(C, Y))