import java.io.*;
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner();
        int n = sc.nextInt();
        SegmentTree st = new SegmentTree(n);
        for (int i = 0; i < n; i++) {
            st.setValue(i, sc.nextLong());
        }
        int right = 0;
        long ans = 0;
        for (int i = 0; i < n; i++) {
            right = Math.max(i, right);
            while (right < n && st.getValue(i, right + 1) > 1) {
                right++;
            }
            if (right >= n) {
                break;
            }
            ans += n - right;
        }
        System.out.println(ans);
    }
    
    static class SegmentTree {
        int size;
        long[] tree;
        
        public SegmentTree(int x) {
            size = 1;
            while (x > size) {
                size <<= 1;
            }
            tree = new long[size * 2 - 1];
        }
        
        public void setValue(int idx, long value) {
            int current = size - 1 + idx;
            tree[current] = value;
            calc((current - 1) / 2);
        }
        
        private void calc(int idx) {
            tree[idx] = getGCD(tree[idx * 2 + 1], tree[idx * 2 + 2]);
            if (idx > 0) {
                calc((idx - 1) / 2);
            }
        }
        
        public long getValue(int left, int right) {
            return getTreeValue(0, 0, size, left, right);
        }
        
        public long getTreeValue(int idx, int min, int max, int left, int right) {
            if (left >= max || right <= min) {
                return 0;
            }
            if (left <= min && max <= right) {
                return tree[idx];
            }
            return getGCD(getTreeValue(idx * 2 + 1, min, (min + max) / 2, left, right), getTreeValue(idx * 2 + 2, (min + max) / 2, max, left, right));
        }
        
        private long getGCD(long x, long y) {
            if (y == 0) {
                return x;
            } else if (x == 0) {
                return y;
            } else {
                return getGCD(y, x % y);
            }
        }
    }
}
class Utilities {
    static String arrayToLineString(Object[] arr) {
        return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n"));
    }
    
    static String arrayToLineString(int[] arr) {
        return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new));
    }
}
class Scanner {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer("");
    StringBuilder sb = new StringBuilder();
    
    public Scanner() throws Exception {
        
    }
    
    public int nextInt() throws Exception {
        return Integer.parseInt(next());
    }
    
    public long nextLong() throws Exception {
        return Long.parseLong(next());
    }
    
    public double nextDouble() throws Exception {
        return Double.parseDouble(next());
    }
    
    public int[] nextIntArray() throws Exception {
        return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }
    
    public String next() throws Exception {
        while (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    
}