n = int(raw_input())

c = 0

pn = []

for i in xrange(n):

    a = int(raw_input())

    if a==2:
        c+=1
        pn.append(a)
        continue

    for x in pn:
        if a==x:
            c+=1
            pn.append(a)
            break

    for x in xrange(2, a):
        if a%x==0:
            break

        if a-1==x and a%x!=0:
            c+=1

print c