#include <bits/stdc++.h>
using namespace std;

int main() {
    int C, Y;
    cin >> C >> Y;

    if(Y % 500 >= C * 100) {
        cout << "no exchange" << endl;
        return 0;
    }

    if(Y / 100 < C) {
        cout << "can't exchange" << endl;
        return 0;
    }

    int ans = Y % 500 / 100;
    
    while(ans < C) {
        ans += 5;
    }

    cout << ans << endl;
    

    return 0;
}