#include using i64 = long long; int main() { i64 c, y; std::cin >> c >> y; if (y < c * 100ll) { std::cout << "can't exchange\n"; } else { i64 c100 = (y % 500) / 100; if (c100 >= c) { std::cout << "no exchange\n"; } else { std::cout << (c - c100 + 4) / 5 * 5 + c100 << "\n"; } } return 0; }