#include using namespace std; int64_t gcd(int64_t a, int64_t b){ return b==0 ? a : gcd(b, a%b); } int main(){ int N, A[50]; cin >> N; for(int i=0; i> A[i]; map mp; mp[0] = 1; for(int i=0; i> pool; for(auto& p : mp) pool.emplace_back(gcd(p.first, A[i]), p.second); for(auto& p : pool) mp[p.first] += p.second; } cout << mp[1] << endl; return 0; }