#include #include #include #include #include #include #include #include #include #include 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("%d", &k); ll ans = 0; 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; }