def prime_numbers(numbers):
    total = 0
    for n in numbers:
        for i in range(2, n):
            if n % i == 0:
                break
        else:
            total += 1
    return total

if __name__ == '__main__':
    n = []
    for _ in range(int(input())):
        n.append(int(input()))
    print(prime_numbers(n))

