i = 100
co = 0
while i<1000:
j = 2
while j < i:
if(i%j == 0):
break
elif(j == i - 1):
co = co + 1
j = j + 1
i = i + 1
print(int(co))
i = 100
co = 0
while i<1000:
j = 2
while j < i:
if(i%j == 0):
break
elif(j == i - 1):
co = co + 1
j = j + 1
i = i + 1
print(int(co))