A = int(input()) B = int(input()) m = (A-1) * 40 M = (A+1) * 40 if m < B and M > B: print(1) else: print(2)