def main():
    N = int(raw_input())
    count = 0
    for i in range(0,N):
        a = int(raw_input())
        if checkPrimeNum(a):
            count += 1
    print count

cached = [2]
def checkPrimeNum(num):
    if num == 2: return True
    start = 2
    for i in cached:
        if num % i == 0:
            return False
    start = cached[-1]
    for i in range(start,num):
        if num % i == 0:
            return False
    cached.append(num)
    return True

main()