#[allow(unused_imports)]
use std::cmp::max;
#[allow(unused_imports)]
use std::cmp::min;
#[allow(unused_imports)]
use std::fmt;
#[allow(unused_imports)]
use std::fmt::Debug;
#[allow(unused_imports)]
use std::io;
#[allow(unused_imports)]
use std::str::FromStr;

fn main() {
    let n: i64 = get_vec_input()[0];

    let mut a: Vec<i64> = get_vec_input();
    a.sort();
    let a_max = a[n as usize - 1];
    let mut dp: Vec<bool> = vec![true; (a_max + 1) as usize];
    let mut count_dp: Vec<i64> = vec![0; (a_max + 1) as usize];

    for &x in a.iter() {
        count_dp[x as usize] += 1;
        for i in 2..=a_max {
            if x * i <= a_max {
                if dp[(x * i) as usize] == false {
                    continue;
                }
                dp[(x * i) as usize] = false;
            } else {
                break;
            }
        }
    }

    if a.len() == 1 {
        println!("1");
        return;
    }

    let result = a
        .iter()
        .map(|&x| x as usize)
        .filter(|&x| count_dp[x] <= 1)
        .filter(|&x| dp[x] == true)
        .collect::<Vec<_>>()
        .len();

    println!("{}", result);
}

// fn main() {
//     let n: i64 = get_vec_input()[0];
//
//     let mut a: Vec<i64> = get_vec_input();
//     a.sort();
//     let mut result: i64 = 0;
//     for i in 0..n as usize {
//         for j in 0..n as usize {
//             if i == j {
//                 if j == n as usize - 1 {
//                     result += 1;
//                 }
//                 continue;
//             }
//             if i < j && a[i] != a[j] {
//                 result += 1;
//                 break;
//             }
//             if a[i] % a[j] == 0 {
//                 break;
//             }
//             if j == n as usize - 1 {
//                 result += 1;
//             }
//         }
//     }
//     println!("{}", result);
// }

#[allow(dead_code)]
fn check_prime(value: i64) -> bool {
    if value == 2 {
        return true;
    }
    if value % 2 == 0 {
        return false;
    }
    for i in 3..(value as f64).sqrt().floor() as i64 {
        if value % i == 0 {
            return false;
        }
    }
    return true;
}

#[allow(dead_code)]
fn get_digit(value: i64) -> i64 {
    let mut digit = 0i64;
    let mut value = value;
    while value != 0 {
        value /= 10;
        digit += 1;
    }
    digit
}

#[allow(dead_code)]
fn sum_digit2(value: String) -> u32 {
    return value.chars().fold(0u32, |a, b| a + b.to_digit(10).unwrap());
}

#[allow(dead_code)]
fn sum_digit(value: i64) -> i64 {
    if value < 10 {
        return value;
    }
    return sum_digit(value / 10) + value % 10;
}

#[allow(dead_code)]
fn update_max<T>(left: &mut T, right: T)
where
    T: std::cmp::Ord + std::clone::Clone,
{
    if *left < right {
        *left = right.clone();
    }
}

#[allow(dead_code)]
fn update_min<T>(left: &mut T, right: T)
where
    T: std::cmp::Ord + std::clone::Clone,
{
    if *left > right {
        *left = right.clone();
    }
}

#[allow(dead_code)]
fn get_vec_input<T>() -> Vec<T>
where
    T: FromStr,
    T::Err: Debug,
{
    let mut input = String::new();
    io::stdin()
        .read_line(&mut input)
        .expect("Failed to read line");
    let vec: Vec<T> = input
        .split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect();
    vec
}

#[allow(dead_code)]
fn get_tuple_input() -> (u64, f32) {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    let mut iter = s.trim().split_whitespace();
    let c: u64 = iter.next().unwrap().parse().unwrap();
    let n: f32 = iter.next().unwrap().parse().unwrap();
    (c, n)
}

#[allow(dead_code)]
fn get_string_input() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).expect("");
    s.trim().to_string()
}


Measured memory_bytes: 12928