#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  int n;
  cin >> n;
  int mn = INT_MAX;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mn = min(mn, v[i]);
  }
  bool x = false;
  int j = 0;
  while (!x) {
    x = true;
    while (mn % ++j)
      ;
    for (int i = 0; i < n; i++) {
      if (v[i] % (mn / j)) {
        x = false;
        break;
      }
    }
  }
  cout << (mn / j) * n << endl;
  return 0;
}
