@staticmethod
def d():
    (n, *a) = map(int, sys.stdin.read().split())
    cand = set(a)
    cnt = 0
    for (x, c) in sorted(Counter(a).items()):
        cnt += ((c == 1) and (x in cand))
        cand -= set(range((x * 2), ((10 ** 6) + 1), x))
    print(cnt)
@staticmethod
def d():
    (n, *a) = map(int, sys.stdin.read().split())
    cand = set(a)
    cnt = 0
    for (x, c) in sorted(Counter(a).items()):
        cnt += ((c == 1) and (x in cand))
        cand -= set(range((x * 2), ((10 ** 6) + 1), x))
    print(cnt)