C, Y = map(int, input().split()) A = [] for i in range(4): A.append(10**i) if i+1 < 4: A.append(10**i*5) A.append(10**3*2) A.append(10**3*5) A.append(10**4) cnt = [0]*10 for i in reversed(range(10)): cnt[i] = Y//A[i] Y %= A[i] if cnt[4] >= C: print("no exchange") else: r = C-cnt[4] c = 0 for i in range(5, 10): c += A[i]//100*cnt[i] if cnt[4]+c >= C: a = (r+5-1)//5 print(a*5+cnt[4]) else: print("can't exchange")