#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  int min = 100;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < min) min = a[i];
  }
  int index = 0;
  for (int i = min; i >= 1; i--) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (a[j] % i == 0) {
        count++;
      }
    }
    if (count == n) {
      index = i;
      break;
    }
  }
  cout << index * n;
  return 0;
}
