#include <bits/stdc++.h>
int n, x[105], poin = 0;
int main() {
  scanf("%d", &n);
  bool modu = false;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x[i]);
  }
  for (int k = 100; k >= 2; k--) {
    for (int i = 1; i <= n; i++) {
      if (x[i] % k == 0) {
        poin++;
        if (poin == n) {
          modu = true;
        }
      } else {
        poin = 0;
        break;
      }
    }
    if (modu) {
      printf("%d\n", k * n);
      break;
    }
  }
  if (!modu) {
    printf("%d\n", n);
  }
  return 0;
}
