import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); HashMap counts = new HashMap<>(); for (int i = 0; i < n; i++) { HashMap nexts = new HashMap<>(); int x = sc.nextInt(); for (int y : counts.keySet()) { int gcd = getGCD(x, y); nexts.put(gcd, nexts.getOrDefault(gcd, 0L) + counts.get(y)); } nexts.put(x, nexts.getOrDefault(x, 0L) + 1); for (int y : nexts.keySet()) { counts.put(y, counts.getOrDefault(y, 0L) + nexts.get(y)); } } System.out.println(counts.getOrDefault(1, 0L)); } static int getGCD(int x, int y) { if (x % y == 0) { return y; } else { return getGCD(y, x % y); } } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); 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 String nextLine() throws Exception { return br.readLine(); } public String next() throws Exception { if (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }