from math import sqrt L, R = map(int, input().split()) t = [True] * (R + 1) for i in range(L, R): if not t[i]: continue j = i * 2 while j <= R: t[j] = False j += i print(t[L:].count(True) - 1)