#include <bits/stdc++.h>
using namespace std;
int a[200];
int main() {
  int n, i, j;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; i++) {
      scanf("%d", &a[i]);
    }
    sort(a, a + n);
    while (a[0] != a[n - 1]) {
      for (i = 1; i < n; i++) {
        if (a[i] % a[0] != 0)
          a[i] = a[i] % a[0];
        else
          a[i] = a[0];
      }
      sort(a, a + n);
    }
    cout << a[0] * n << endl;
  }
  return 0;
}
