www.jungol.co.kr/bbs/board.php?bo_table=pbank&wr_id=2079&sca=2040
import math
def is_prime_number(x):
for i in range(2, int(math.sqrt(x))+1):
if x%i == 0:
return False
return True
n, m = map(int, input().split())
cnt = 0
for a in range(n, m+1):
if is_prime_number(a):
cnt += 1
print(cnt)