A = int(input()) B = int(input()) if A / 5000 == B / 200000: print(1) else: print(2)