#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  while (b != 0) {
    int r = a % b;
    a = b;
    b = r;
  }
  return a;
}
void FindMinimum(int a[], int &n) {
  int g = gcd(a[0], a[1]);
  for (int i = 2; i < n; ++i) g = gcd(a[i], g);
  cout << g * n;
}
int main() {
  int n, a[100];
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  FindMinimum(a, n);
  return 0;
}
