#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, j = 0, count = 0, d = 100;
  cin >> n;
  int x[n];
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  while (count < n) {
    if (x[j] % d == 0) {
      count++;
    }
    j++;
    if (j == n && count != n) {
      j = 0;
      count = 0;
      d--;
    }
  }
  cout << d * n;
  return 0;
}
