#include #include #include #include #include #include #include using namespace std; typedef long long ll; int gcd(int a, int b){ if(a < b) swap(a, b); while(b != 0){ int tmp = a%b; a = b; b = tmp; } return a; } map mp; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << setprecision(10) << fixed; int N; int A[50]; cin >> N; for(int i = 0; i < N; i++){ cin >> A[i]; } //mp[1] = 1; for(int i = 0; i < N; i++){ if(mp.count(A[i]) == 0){ mp[A[i]] = 1; }else{ mp[A[i]] += 1; } for(auto iter = mp.begin(); iter != mp.end(); iter++){ int m = iter->first; // if(m == A[i]) { // continue; // } ll n = iter->second; int g = gcd(m, A[i]); if(mp.count(g) == 0){ mp[g] = n; }else{ mp[g] += n; } } } cout << mp[1]/2 << endl; }