#include using namespace std; int main() { int N; { cin >> N; } vector A(N); { for (int i = 0; i < N; ++i) cin >> A[i]; } map d; { d[0] = 1; for (int i = 0; i < N; ++i) { map nd; { for (auto it : d) { int v; int64_t c; tie(v, c) = it; nd[__gcd(v, A[i])] += c; nd[v] += c; } } swap(d, nd); } } cout << d[1] << endl; }