def main(): l, r = map(int, input().split()) ans = 0 if l <= 295 and 296 <= r: ans += 1 if l <= 416 and 417 <= r: ans += 1 print(ans) return main()