import sys from math import gcd import itertools read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N,*A = map(int, read().split()) A = [0] + A + [1] stack = [0] r = 0 rv = 0 answer = 0 for l in range(1, N+1): stack.pop() if not stack: stack = [0] + list(itertools.accumulate(itertools.chain(A[r:l-1:-1]), gcd)) rv = 0 x = stack[-1] while gcd(x, rv) != 1: r += 1 rv = gcd(rv, A[r]) answer += N+1-r print(answer)