def ip():return int(input()) def mp():return map(int, input().split()) def lmp():return list(map(int, input().split())) # 岩プロコン2 A No.3259 C++ → Rust → Python L, R = mp() if R <= 295 or (296 <= L and R <= 416) or 417 <= L: print(0) elif (L <= 295 and 296 <= R <= 416) or (296 <= L <= 416 and 417 <= R): print(1) else: print(2)