#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define int long long typedef vector VI; typedef pair pii; #define fore(i,a) for(auto &i:a) #define REP(i,n) for(int i=0;i > dp; //vector > > vvvi; //dp=vector >(N, vector(M,0)); //vector > v; //v.push_back(make_pair(x,y)); //priority_queue, greater > q2; int gcd(int a, int b) {//最大公約数 if (b == 0)return a; return gcd(b, a%b); } signed main(){ cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; VI A(N); REP(i, N)cin >> A[i]; vector > dp(N); int ans = 0; REP(i, N) { dp[i][A[i]]++; FOR(j, i + 1, N) { for (auto e : dp[i]) { dp[j][gcd(e.first, A[j])] += e.second; } } ans += dp[i][1]; } cout << ans << endl; return 0; }