//
//  main.swift
//
//  Created by sun-yryr
//  Copyright © 2019 sun-yryr. All rights reserved.
//

import Foundation

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) {return (a[0], a[1])}
prefix func * <T> (a: [T]) -> (T, T, T) {return (a[0], a[1], a[2])}


func readInt(separator s: Character = " ") -> [Int] {return readLine()!.split(separator: s).map({Int($0)!})}
func readDouble(separator s: Character = " ") -> [Double] {return readLine()!.split(separator: s).map({Double($0)!})}
func readElement(separator s: Character = " ") -> [String] {return readLine()!.split(separator: s).map({String($0)})}

extension String {
    func at(_ i: Int) -> Character {
        precondition(0 <= i && i < self.count)
        return self[self.index(self.startIndex, offsetBy: i)]
    }
}

// 約数の計算。過程でtargetが出てきたらtrue
func yakusu(ai: Int, targets: Set<Int>) -> Bool {
    for i in 1...Int(floor(sqrt(Double(ai)))) {
        if (ai.isMultiple(of: i)) {
            if (targets.contains(i) || targets.contains(ai/i)) {
                return true
            }
        }
    }
    return false
}

func main() {
    let N = readInt()[0]
    let sortedA = readInt().sorted(by: <)
    var ans = 0
    var used = Set<Int>()
    for ai in sortedA {
        if (used.contains(ai)) {
            ans -= 1
            continue
        }
        if (yakusu(ai: ai, targets: used)) {
            continue
        }
        used.insert(ai)
        ans += 1
    }
    print(ans <= 0 ? 0 : ans)
}
main()
