#include <bits/stdc++.h>
using namespace std;
typedef vector<vector<long long> > vvl;
long long x, y, j, i, t, n, input, ok;
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  long long ans, ara[105];
  cin >> n;
  cin >> ara[0];
  ans = ara[0];
  for (long long i = 1; i < n; i++) {
    cin >> ara[i];
    ans = gcd(ans, ara[i]);
  }
  cout << ans * n << "\n";
  return 0;
}
