import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int n = stdin.nextInt(); int[] x = new int[n]; for (int i = 0; i < n; i++) { x[i] = stdin.nextInt(); } Arrays.sort(x); int[] dp = new int[n]; Arrays.fill(dp, 1); for (int i = 0; i < n; i++) { for (int j = i + 1; j < n; j++) { if (x[j] % x[i] == 0) { dp[j] = Math.max(dp[i] + 1, dp[j]); } } } int ans = Arrays.stream(dp).max().getAsInt(); System.out.println(ans); } }