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