a = int(input()) b = int(input()) print(1 if b <= a*1000 else 2)