#include #define rep(i,n) for (int i = 0; i < (n); i ++) using namespace std; typedef long long ll; typedef pair PL; typedef pair P; const int INF = 1e9; const ll MOD = 1e9 + 7; const vector dy = {-1,0,1,0}; const vector dx = {0,1,0,-1}; int main() { int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; map dp; for (int x:a) { map now; now[x] = 1; for (auto p:dp) { now[p.first] += p.second; now[__gcd(x,p.first)] += p.second; } dp = now; } cout << dp[1] << endl; return 0; }