from math import gcd import sys readline = sys.stdin.readline def push(a, x): a.append((x, gcd(x, a[-1][1]))) def pop(front, back): if len(back) == 1: for _ in range(len(front)-1): back.append(gcd(front.pop()[0], back[-1])) back.pop() def fold(front, back): return gcd(front[-1][1], back[-1]) N = int(input()) a = list(map(int, input().split())) r = 0 ans = 0 front, back = [(0, 0)], [0] for l in range(N): while r < N and gcd(fold(front, back), a[r]) != 1: push(front, a[r]) r += 1 ans += N - r if l < r: pop(front, back) else: r += 1 print(ans) print(1)