//
//  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 dp = Array<Bool>.init(repeating: true, count: sortedA[sortedA.count-1]+1)
    var used = Set<Int>()
    for ai in sortedA {
        if (used.contains(ai)) {
            dp[ai] = false
            continue
        } else {
            used.insert(ai)
            var multipleAi = ai * 2
            while(multipleAi < dp.count) {
                dp[multipleAi] = false
                multipleAi += ai
            }
        }
    }
    var ans = 0
    for ai in used {
        if (dp[ai] == true) {
            ans += 1
        }
    }
    print(ans)
}
main()
