import sys;input=sys.stdin.readline def gcd(a,b): if b == 0: return a return gcd(b,a%b) if __name__ == '__main__': n = int(input()) X = list(map(int, input().split())) num = 2**(n-1).bit_length() seg=[0]*2*num for i in range(n): seg[i+num-1]=X[i] for i in range(num-2,-1,-1) : seg[i]=gcd(seg[2*i+1],seg[2*i+2]) j = 1 r = 0 for i in range(n): while j <= n: p, q = i, j res=0 if q<=p: j+=1 continue p += num-1 q += num-2 while q-p>1: if p&1 == 0: res = gcd(res,seg[p]) if q&1 == 1: res = gcd(res,seg[q]) q -= 1 p = p//2 q = (q-1)//2 if p == q: res = gcd(res,seg[p]) else: res = gcd(gcd(res,seg[p]),seg[q]) if res == 1: break j += 1 r += n+1-j print(r)