#include #include using namespace std; int gcd(int a, int b){ return b==0 ? a : gcd(b, a%b); } int main(){ int n; cin >> n; map dp; dp[0] = 1; for(int i = 0; i < n; i++){ map ndp = dp; int x; cin >> x; for(auto p : dp) ndp[gcd(p.first,x)] += p.second; dp = ndp; } cout << dp[1] << endl; return 0; }