import Foundation
// Decimal型の有効桁数は38桁
let N = readLine()!.components(separatedBy: " ").map { Int($0)! }.first!
let A = readLine()!.components(separatedBy: " ").map { Int($0)! }

let sortedA = A.enumerated().sorted(by: {$0.element < $1.element })
print(sortedA)

var ng = Set<Int>.init(minimumCapacity: N)
var count = 0
var isBreak = false
for i in 1...N {
    if !ng.contains(sortedA[i - 1].element) {
        if i == 1 && sortedA[i - 1].element != sortedA[i].element {
            break
        }
        isBreak = false
        for j in 1...i {
            if sortedA[i - 1].element % sortedA[j - 1].element == 0 && sortedA[i - 1].offset != sortedA[j - 1].offset {
                print(sortedA[i - 1])
                ng.insert(sortedA[i - 1].element)
                isBreak = true
                break
            }
        }
        print("\(isBreak) \(sortedA[i - 1])")
        count += isBreak ? 0 : 1
    }
}

print(count)
