from collections import defaultdict from math import gcd N = int(input()) a = list(map(int, input().split())) d = defaultdict(int) d[a[0]] = 1 for i in range(1,N): nex = defaultdict(int) nex[a[i]] = 1 for key in d.keys(): nex[gcd(a[i],key)]+=d[key] nex[key]+=d[key] d = nex print(d[1])