#include <bits/stdc++.h>
using namespace std;
int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
int arr[107];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int cnt = arr[0];
  for (int i = 1; i < n; i++) {
    int curr = arr[i];
    if (cnt > curr) swap(cnt, curr);
    cnt = gcd(cnt, curr);
  }
  cout << cnt * n << endl;
  return 0;
}
