from collections import defaultdict from math import gcd N = int(input()) A = map(int, input().split()) dp = defaultdict(int) for a in A: new_dp = dp.copy() new_dp[a] += 1 for k, v in dp.items(): new_dp[gcd(a, k)] += v dp = new_dp print(dp[1])