let split_string ?(pattern="") = Str.split @@ Str.regexp pattern
let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n
let a = read_line () |> split_string ~pattern:" " |> List.map int_of_string |> List.sort compare

let rec loop acc = function
  | [] -> Printf.printf "%d\n" @@ List.length acc
  | x :: xs -> loop (x :: acc) (List.filter (fun i -> i mod x <> 0) xs)

let () = 
  if List.for_all (fun i -> i = List.hd a) a then print_endline "0"
  else loop [] a