#include #include #include #include #include #include #include #include #include #include #include using namespace __gnu_pbds; static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max()/32*15+208; int main() { int n; cin >> n; vector v(n); for (auto &&k : v) scanf("%lld", &k); ll ans = 0; using M = gp_hash_table; vector X(2); for (int i = 0; i < n; ++i) { int now = i&1, nxt = now^1; X[now].clear(); for (auto &&j : X[nxt]) { X[now][__gcd(j.first, v[i])] += j.second; } X[now][v[i]]++; ans += X[now][1]; } cout << ans << "\n"; return 0; }