MOD = 10 ** 9 + 7 INF = 10 ** 12 import sys sys.setrecursionlimit(1000000) dy = (-1,0,1,0) dx = (0,1,0,-1) from itertools import permutations def main(): n = int(input()) a = list(map(int,input().split())) M = max(a) ans = 2 flag = False for i in range(2,int(M ** 0.5 + 1)): before = a[0] length = 1 power = i for j in range(1,n): if a[j]%power == 0 and before < a[j]: length += 1 power *= i else: before = min(before,a[j]) if power != i: flag = True ans = max(ans,length) if flag == False: print(1) else: print(ans) if __name__ =='__main__': main()