import math n = int(input()) a = list(map(int, input().split())) prev_gcds = {} ans = 0 for num in a: current_gcds = {} # Process previous GCDs for g in prev_gcds: new_g = math.gcd(g, num) if new_g in current_gcds: current_gcds[new_g] += prev_gcds[g] else: current_gcds[new_g] = prev_gcds[g] # Add the current number itself new_g = num if new_g in current_gcds: current_gcds[new_g] += 1 else: current_gcds[new_g] = 1 # Update the answer ans += current_gcds.get(1, 0) # Update prev_gcds for next iteration prev_gcds = current_gcds.copy() print(ans)