import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random #sys.setrecursionlimit(10**9) #sys.set_int_max_str_digits(0) input = sys.stdin.readline c,y = map(int,input().split()) if y // 100 < c: exit(print('can\'t exchange')) d = collections.defaultdict(int) z = [1,5,10,50,100,500,1000,2000,5000,10000] for i in reversed(z): d[i] = y // i y %= i if d[100] >= c: exit(print('no exchange')) while d[100] < c: d[100] += 5 exit(print(d[100])) ans = 0 now = d[100] for i in reversed(z): if i <= 100: break if now >= c: break while d[i] > 0 and now < c: now += i // 100 d[i] -= 1 ans += 1 print(ans)