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