import sys input = lambda : sys.stdin.readline().rstrip() sys.setrecursionlimit(2*10**5+10) write = lambda x: sys.stdout.write(x+"\n") debug = lambda x: sys.stderr.write(x+"\n") writef = lambda x: print("{:.12f}".format(x)) n = int(input()) a = list(map(int, input().split())) d = {0:1} from math import gcd for i in range(n): v = a[i] nd = dict(d) for k,val in d.items(): nk = gcd(k, v) nd.setdefault(nk, 0) nd[nk] += val d = nd ans = d.get(1,0) print(ans)