X,Y=map(int,input().split()) c=[1,5,10,50,100,500,1000,2000,5000,10000] d={v:i for i,v in enumerate(c)} a=[0]*len(c) for v in c[::-1]: a[d[v]]=Y//v Y%=v if a[d[100]]>=X: print("no exchange") elif sum(a[d[500]:])>0: print(a[d[100]]+5) else: print("can't exchange")