l, r = map(int, input().split()) ans = (l <= 295 and 296 <= r) + (l <= 416 and 417 <= r) print(ans)