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