if __name__ == "__main__":
    import sys
    import math
    N = int(sys.stdin.readline().strip())
    numbers = []
    for i in range(N):
        n = int(sys.stdin.readline().strip())
        if n > 1:
            numbers.append(n)
    maxNum = max(numbers)
    for i in range(2, int(math.sqrt(maxNum)) + 1):
        for j, n in enumerate(numbers):
            if n%i == 0:
                del numbers[j]
    print len(numbers)