import sys sys.setrecursionlimit(10000) input = sys.stdin.buffer.readline N = int(input()) A = list(map(int,input().split())) def GCD(l,r): return l if r == 0 else GCD(r,l % r) M = 1 while M < N: M *= 2 node = [0]*(2*M) for i in range(N): node[i+M] = A[i] def update(idx,var): idx += M node[idx] = var while idx > 0: idx >>= 1 node[idx] = GCD(node[2*idx + 0],node[2*idx + 1]) def get(l,r): vl = 0 vr = 0 l += M r += M while l < r: if l&1 : vl = GCD(vl,node[l]) l += 1 if r&1 : r -= 1 vr = GCD(node[r],vr) return GCD(vl,vr) ans = 0 r = 1 for i in range(N): while r <= N: if get(i,r) == 1: break r += 1 ans += N+1-r print(ans)