#include using namespace std; #define INF 2000000000 #define MOD 1000000007 typedef long long ll; typedef pair P; int gcd( int m, int n ) { // 引数に0がある場合は0を返す if ( ( 0 == m ) || ( 0 == n ) ) return 0; // ユークリッドの方法 while( m != n ) { if ( m > n ) m = m - n; else n = n - m; } return m; }//gcd int main() { int n; cin >> n; int a[n]; int b[n]; for (int i = 0; i < n; i++) { cin >> a[i]; } int l=a[0]; for (int i = 1; i < n-1; i++) { l = gcd(a[i],l); } for (int i = 0; i < n; i++) { b[i] = a[i]/l; } int ret = accumulate(b,b+n,0); cout << ret << endl; }