import java.util.*; import java.io.*; public class Main { public static void main (String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] first = br.readLine().split(" "); int n = Integer.parseInt(first[0]); SegmentTree st = new SegmentTree(n); String[] second = br.readLine().split(" ", n); for (int i = 0; i < n; i++) { st.set(i, Long.parseLong(second[i])); } st.updateAll(); long total = 0; int idx = 0; for (int i = 0; i < n && idx < n; i++) { idx = Math.max(idx, i); while (idx < n && st.query(i, idx) > 1) { idx++; } if (idx >= n) { break; } total += n - idx; } System.out.println(total); } static class Path implements Comparable { int row; int col; int value; int count; public Path(int row, int col, int value, int count) { this.row = row; this.col = col; this.value = value; this.count = count; } public int compareTo(Path another) { return value - another.value; } } } class SegmentTree { int size; int base; long[] tree; public SegmentTree(int size) { this.size = size; base = 1; while (base < size) { base <<= 1; } tree = new long[base * 2 - 1]; } public void set(int idx, long value) { tree[idx + base - 1] = value; } public void updateAll() { update(0); } public long update(int idx) { if (idx >= base - 1) { return tree[idx]; } return tree[idx] = getGCD(update(2 * idx + 1), update(2 * idx + 2)); } public long query(int min, int max) { return query(min, max, 0, 0, base); } public long query(int min, int max, int idx, int left, int right) { if (min >= right || max < left) { return 0; } if (min <= left && right - 1 <= max) { return tree[idx]; } long x1 = query(min, max, 2 * idx + 1, left, (left + right) / 2); long x2 = query(min, max, 2 * idx + 2, (left + right) / 2, right); return getGCD(x1, x2); } private long getGCD(long x, long y) { if (x == 0) { return y; } if (y == 0) { return x; } if (x % y == 0) { return y; } else { return getGCD(y, x % y); } } }