a = int(input()) b = int(input()) if b // 40 in [a - 1, a, a + 1]: print(1) else: print(2)