mod = 1000000007 eps = 10**-9 def main(): import sys from collections import defaultdict input = sys.stdin.readline def gcd(a, b): while a%b: a, b = b, a%b return b N = int(input()) A = list(map(int, input().split())) G = defaultdict(int) for a in A: tmp = [] for v in G: tmp.append((gcd(v, a), G[v])) for x, y in tmp: G[x] += y G[a] += 1 print(G[1]) if __name__ == '__main__': main()