def isPrime(n):
    if (n < 4):
        return True
    for i in range(2, (n / 2) + 1):
        if (0 == (n % i)):
            return False
    return True

def main():
    c = 0
    n = input()
    for i in range(n):
        if (isPrime(input())):
            c += 1
    print(c)

main()