N=int(input()) A=list(map(int,input().split())) from math import gcd from collections import Counter import copy NOW=Counter() NOW[0]=1 for a in A: NB=copy.deepcopy(NOW) for nb in NB: NOW[gcd(nb,a)]+=NB[nb] print(NOW[1])