def main(): import sys input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) dp = [[A[0]]] for a in A[1:]: ok = -1 ng = len(dp) mid = (ok+ng)//2 while ng - ok > 1: flg = 0 for b in dp[mid]: if a%b == 0 and a > b: #print(a, b, mid) flg = 1 break if flg: #print(a, mid) ok = mid else: ng = mid mid = (ok+ng)//2 if ok == len(dp)-1: dp.append([a]) else: dp[ok+1].append(a) print(len(dp)) #print(dp) if __name__ == '__main__': main()