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 TreeSet<>()); list.get(0).add(sc.nextInt()); for (int i = 1; i < n; i++) { int x = sc.nextInt(); int left = -1; int right = list.size(); while (right - left > 1) { int m = (left + right) / 2; boolean exist = false; for (int y : list.get(m)) { if (y / 2 > x) { break; } if (x % y == 0 && x > y) { exist = true; break; } } if (exist) { left = m; } else { right = m; } } if (left == list.size() - 1) { list.add(new TreeSet<>()); } list.get(left + 1).add(x); } System.out.println(list.size()); } }