#include int ri() { int n; scanf("%d", &n); return n; } int gcd(int a, int b) { if (a >= 1000000000) return b; if (b >= 1000000000) return a; while (a && b) { if (a > b) a %= b; else b %= a; } return a + b; } int main() { int n = ri(); int a[n]; for (int i = 0; i < n; i++) a[i] = ri(); std::map dp; dp[a[0]] = 1; dp[1000000000] = 1; for (int i = 1; i < n; i++) for (auto &j : dp) dp[gcd(j.first, a[i])] += (int64_t) j.second; std::cout << dp[1] << std::endl; return 0; }