#include #define rep(i,n) for(int i=0;i ; const int INF = 1e9; const int MOD = 1000000007; ll gcd(ll i,ll j){ if(j == 0) return i; return gcd(j,i%j); } int main(){ int n; cin >> n; vector a(n); rep(i,n) cin >> a[i]; vector> dp(n+1); dp[0][0] = 1; for(int i=1;i<=n;i++){ for(auto p:dp[i-1]){ dp[i][gcd(p.first,a[i-1])] += p.second; dp[i][p.first] += p.second; } } cout << dp[n][1] << endl; return 0; }