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); TreeSet set = new TreeSet<>(); int max = 1; for (int i = n - 1; i >= 0; i--) { boolean flag = true; for (Unit u : set) { if (u.value % arr[i] == 0) { set.add(new Unit(i, arr[i], u.count + 1)); max = Math.max(max, u.count + 1); flag = false; break; } } if (flag) { set.add(new Unit(i, arr[i], 1)); } } System.out.println(max); } static class Unit implements Comparable { int idx; int value; int count; public Unit (int idx, int value, int count) { this.idx = idx; this.value = value; this.count = count; } public int hashCode() { return idx; } public int compareTo(Unit another) { if (count == another.count) { return idx - another.idx; } else { return another.count - count; } } public boolean equals(Object o) { Unit u = (Unit) o; return idx == u.idx && count == u.count; } } }