#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++) { vector a; a.push_back(A[i]); for (auto &[k, v] : m) { for (int j = 0; j < v; j++) a.push_back(gcd(A[i], k)); } for (auto e : a) { if (m.count(e) == 0) m[e] = 1; else m[e]++; } } cout << m[1] << endl; }