N = int(input()) A = list(map(int,input().split())) def gcd(a,b): if a == 0:return b if b == 0:return a while True: r = a % b a = b b = r if r == 0:return a from collections import defaultdict d = defaultdict(int) d[0] = 1 for i in range(N): e = defaultdict(int) for v in d: e[v] += d[v] e[gcd(v,A[i])] += d[v] d = e print(d[1])