func readIntArray() -> [Int] {
    readLine()!.split(separator: " ").map({Int($0)!})
}

struct LinkedList<T> {
    
    var first: Node?
    var last: Node?
    
    var isEmpty: Bool {
        return first == nil
    }
    
    mutating func append(_ e: T) -> Void {
        let node = Node(e)
        if first == nil {
            first = node
        }
        if let lastElement = last {
            lastElement.next = node;
            node.prev = lastElement;
        }
        last = node
    }
    
    mutating func delete(_ node: Node) -> Node? {
        if let prev = node.prev {
            prev.next = node.next
        } else {
            first = node.next
        }
        if let next = node.next {
            next.prev = node.prev
            return next
        } else {
            last = node.prev
            return nil
        }
    }
    
    mutating func removeFirst() -> T? {
        guard let firstNode = first else {
            return nil
        }
        delete(firstNode)
        return firstNode.value
    }
    
    class Node {
        var value: T
        var prev: Node?
        var next: Node?
        
        init(_ value: T) {
            self.value = value
        }
    }
}

let N = Int(readLine()!)!
var A = readIntArray()
A.sort()

var list = LinkedList<Int>()

A.forEach({
    list.append($0)
})

var temp = list.first
var count = 0

while temp != nil {
    let d = temp!.value
    print(d)
    var next = temp?.next
    var duplicate = false
    while next != nil {
        let x = next!.value
        if (x % d == 0) {
            if (x == d) {
                duplicate = true
            }
            next = list.delete(next!)
        } else {
            next = next?.next
        }
    }
    if !duplicate {
        count += 1
    }
    temp = temp?.next
}
print(count)
