A = int(input()) B = int(input()) PA = A / 5000 QA = A / (5000 ** 2) if abs(B - PA * 200000) < abs(B - QA * (200000 ** 2)): print(1) else: print(2)