import math from collections import defaultdict n = int(input()) a = list(map(int, input().split())) total = 0 prev_gcd = dict() for num in a: current_gcd = defaultdict(int) current_gcd[num] = 1 for g, cnt in prev_gcd.items(): new_g = math.gcd(g, num) current_gcd[new_g] += cnt total += current_gcd.get(1, 0) prev_gcd = current_gcd print(total)