import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); TreeMap dp = new TreeMap<>(); dp.put(sc.nextInt(), 1L); for (int i = 1; i < n; i++) { int x = sc.nextInt(); Integer key = 0; while ((key = dp.higherKey(key)) != null) { int gcd = getGCD(key, x); dp.put(gcd, dp.getOrDefault(gcd, 0L) + dp.get(key)); } dp.put(x, dp.getOrDefault(x, 0L) + 1L); } System.out.println(dp.getOrDefault(1, 0L)); } static int getGCD(int x, int y) { if (x % y == 0) { return y; } else { return getGCD(y, x % y); } } }