#include <cstdio>
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cctype>
#include <bitset>
#include <cmath>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
using namespace std;
typedef long long ll;
int n;

int gcd(int a,int b){
	return b==0?a:gcd(b,a%b);
}
void solve(){
	scanf("%d",&n);
	int GCD=0;
	for(int i=1;i<=n;i++){
		int x;
		scanf("%d",&x);
		GCD=gcd(GCD,x);
	}
	printf("%d\n",GCD);
}
int main(){
	solve();
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for( int i=0; i<(n); i++)

int main(){
    ll n; cin >> n;
    map<ll, ll> mp;
    for(int i = 0; i < n; i++){
        int a; cin >> a;
        mp[a] += 1;
    }

    ll res = 0;

    auto begin = mp.begin(), end = mp.end();
    for(auto iter = begin; iter != end; iter++) res += iter->second * (iter->second - 1) / 2;

    cout << n*(n-1)/2 - res << endl;
}