A,B=int(input()),int(input()) dic = {1:abs(B-A*40),2:abs(B-A*(40**2))} sorted_dic = sorted(dic.items(), key= lambda x:x[1]) print(sorted_dic[0][0])