#include using namespace std; long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } int main() { int N; cin >> N; vector A(N); for (auto &a : A) cin >> a; map m; for (int i = 0; i < N; i++) { map a; a[A[i]] = 1; for (auto &[k, v] : m) { int g = gcd(A[i], k); if (a.count(g) == 0) a[g] = v; else a[g] += v; } for (auto &[k, v] : a) { if (m.count(k) == 0) m[k] = v; else m[k] += v; } } cout << m[1] << endl; }