from collections import defaultdict
import math

def is_prime(x):
    if x == 1 : return False
    else : return all([x%i != 0 for i in range(2,int(math.sqrt(x)+1))])



if __name__ == '__main__' :
    N = int(input())
    count = 0
    for i in range(N):
        count += is_prime(int(input()))
    print(count)

