from sys import stdin
def stdinput():
    return stdin.readline().strip()

def main():
    n = int(stdinput())
    inputs = list(map(int, [stdinput() for _ in range(n)]))
    inputs = sorted(inputs)

    cache = [2]
    primes = list(filter(lambda a: is_prime(a, cache), inputs))
    print(len(primes))

def is_prime(a, primes):
    if a == 2:
        return True
    for p in primes:
        if a % p == 0:
            return False
    for b in range(max(primes), a // 2):
        if any(map(lambda p: b % p != 0, primes)):
            primes.append(b)
        if a % b == 0:
            return False
    return True

if __name__ == '__main__':
    main()
