a = int(input()) b = int(input()) t = (200000) ** 2 / (5000) ** 2 if len(str(b)) < len(str(b - t * a)): print(1) else: print(2)