L, R = (int(x) for x in input().split()) if R <= 295 or 296 <= L <= R <= 416 or 417 <= L: print(0) elif L <= 295 and R >= 417: print(2) else: print(1)