#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, num[105];
  cin >> n;
  for (int i = 0; i < n; i++) scanf("%d", &num[i]);
  int ma, lim = *(min(&num[0], num + n));
  for (int i = 1; i <= lim; i++) {
    int can = 1;
    for (int k = 0; k < n; k++)
      if (num[k] % i != 0) can = 0;
    if (can == 1) ma = i;
  }
  cout << ma * n;
  return 0;
}
