n = int(raw_input())

i, c = 0, 0

while(i<n):
    a = int(raw_input())

    if a==2:
        c+=1

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

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

    i+=1
print c