L, R = map(int, input().split()) cnt = 0 for i in range(L, R + 1): if i in [295, 416] and i != R: cnt += 1 print(cnt)