import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] arr = new int[n]; for (int i = 0; i < n; i++) { arr[i] = sc.nextInt(); } Arrays.sort(arr); ArrayList> exists = new ArrayList<>(); exists.add(new ArrayList<>()); exists.get(0).add(1); for (int i = 0; i < n; i++) { boolean hit = false; for (int j = exists.size() - 1; j >= 0 && !hit; j--) { for (int x : exists.get(j)) { if (arr[i] % x == 0) { if (j == exists.size() - 1) { exists.add(new ArrayList<>()); } exists.get(j + 1).add(arr[i]); hit = true; break; } } } } System.out.println(exists.size() - 1); } }