#!/usr/bin/env python
# -*- coding:utf-8 -*-
#from __future__ import print_function
import time
import sys
import io
import re
import math
start = time.clock()
cnt=0
sute=0
N=int(raw_input())
while sute==0:
    for j in range(N):
        x=int(raw_input())
        if x<2:
            pass
        elif x==2:
            cnt+=1
        elif x%2==0:
            pass
        else:
            a=3
            while a**2<=x:
                if x%a==0:
                    pass
                a+=2
            cnt+=1
#        print j
#        print cnt
        if j==N-1:
            sute+=1
    sute+=1


print cnt