#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int main() {
  long long int n, x, a[101];
  cin >> n;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  }
  x = a[0];
  for (long long int i = 1; i < n; i++) {
    x = gcd(x, a[i]);
  }
  cout << x * n;
  return 0;
}
