# 20分までしか一問かけちゃダメ import sympy from math import gcd N = int(input()) a = list(map(int, input().split())) d = set() for n in a: x = sympy.divisors(n) for div in x: d.add(div) d = list(d) d.sort() dp = [{numbers: 0 for numbers in d} for i in range(N+1)] # dp[X][num]:= X 版目まで見てgcdがnumになる物の個数 for i in range(N): num = a[i] dp[i+1][num]+=1 for numbers in d: dp[i+1][gcd(numbers, num)] += dp[i][numbers] dp[i+1][numbers]+=dp[i][numbers] res = dp[N][1] print(res)