import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); ArrayList> list = new ArrayList<>(); list.add(new HashSet<>()); list.get(0).add(sc.nextInt()); for (int i = 1; i < n; i++) { int x = sc.nextInt(); boolean flag = false; for (int y : list.get(0)) { if (x % y == 0 && x > y) { flag = true; break; } } if (!flag) { list.get(0).add(x); continue; } int left = 0; int right = list.size(); while (right - left > 1) { int m = (left + right) / 2; boolean exist = false; for (int y : list.get(m)) { if (x % y == 0 && x > y) { exist = true; break; } } if (exist) { left = m; } else { right = m; } } if (left == list.size() - 1) { list.add(new HashSet<>()); } list.get(left + 1).add(x); } System.out.println(list.size()); } }