count=0
a= list(map(int, input().split()))
for i in range(len(a)):
flag=0
if a[i] > 2:
for j in range(2,a[i]):
if a[i]%j==0:
flag=1
if flag==0:
count+=1
if a[i] ==2:
count+=1
print(count)