prime_list = [2,3,5,7,11]
def appendp(num):
    for i in range(prime_list[-1], num+1, 2):
        for j in prime_list:
            if i % j == 0 or i in prime_list:
                break
            if j == prime_list[-1]:
                prime_list.append(i)

def prime_number():
    n = int(input())
    count = 0
    for _ in range(n):
        a = int(input())
        if a > prime_list[-1]:
            appendp(a)
        if a in prime_list:
            count += 1
    print(count)


if __name__ == "__main__":
    prime_number()