#include <bits/stdc++.h>
using namespace std;
int n, minn = 999;
int a[201];
int work(int k) {
  for (int i = 1; i <= n; i++) {
    if (a[i] % k != 0) return 0;
  }
  return 1;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (a[i] < minn) minn = a[i];
  }
  for (int i = minn; i >= 1; i--) {
    if (work(i) == 1) {
      printf("%d", i * n);
      break;
    }
  }
  return 0;
}
