from collections import defaultdict import math n = int(input()) a = list(map(int, input().split())) dp = defaultdict(int) dp[a[0]] = 1 for i in range(1, n): ndp = defaultdict(int) ndp[a[i]] += 1 for k, v in dp.items(): ndp[k] += v ndp[math.gcd(k, a[i])] += v dp = ndp print(dp[1])