from collections import defaultdict from math import gcd n = int(input()) *a, = map(int,input().split()) d = defaultdict(int) d[0] = 1 for ai in a: nd = d.copy() for k,v in d.items(): nd[gcd(ai,k)] += v d = nd print(d[1])