#![allow(unused_imports)]

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::{min, max};
use std::collections::{HashMap, HashSet, VecDeque, BinaryHeap};

fn main() {
    input!{
        n: usize,
        mut v: [usize; n]
    }
    v.sort();
    let mut w = vec![v[0]];
    let mut i = 1;
    let mut set = HashSet::new();
    while i < n {
        if v[i - 1] == v[i] {
            set.insert(v[i]);
            while i < n && v[i - 1] == v[i] {
                i += 1;
            }
            w.pop();
        }
        if i < n {
            w.push(v[i]);
            i += 1;
        }
    }
    let mut ans = w.len();
    'next: for &m in &w {
        for &d in &divisors(m) {
            if set.contains(&d) {
                ans -= 1;
                continue 'next;
            }
        }
        set.insert(m);
    }
    println!("{}", ans);
}

fn factor(mut n: usize) -> Vec<(usize, usize)> {
    let mut ret = vec![];
    let mut p = 0;
    while n % 2 == 0 {
        p += 1;
        n /= 2;
    }
    if p != 0 {
        ret.push((2, p));
    }
    let mut r = 3;
    while r * r <= n {
        p = 0;
        while n % r == 0 {
            p += 1;
            n /= r;
        }
        if p != 0 {
            ret.push((r, p));
        }
        r += 2;
    }
    if n != 1 {
        ret.push((n, 1));
    }
    ret
}

fn divisors(n: usize) -> Vec<usize> {
    if n == 1 {
        return vec![1];
    }
    let mut ret = vec![];
    let fac = factor(n);
    let m = fac.len();
    let mut st = vec![0; m];
    while st[m - 1] <= fac[m - 1].1 {
        let mut d = 1;
        for i in 0..m {
            d *= fac[i].0.pow(st[i] as u32);
        }
        ret.push(d);
        st[0] += 1;
        let mut j = 0;
        while j < m - 1 && st[j] > fac[j].1 {
            st[j] = 0;
            st[j + 1] += 1;
            j += 1;
        }
    }
    ret
}


Measured memory_bytes: 9696