#include <bits/stdc++.h>
int gcd(int num1, int num2);
int main() {
  int n;
  scanf("%d", &n);
  if (n >= 2 && n <= 100) {
    int a[n], i = 0, m = n;
    while (m--) {
      scanf("%d", &a[i]);
      i++;
    }
    i = 0;
    int ans = gcd(a[0], a[1]);
    while (i < n - 1) {
      ans = gcd(ans, gcd(a[i], a[i + 1]));
      i++;
    }
    ans *= n;
    printf("%d", ans);
  }
  return 0;
}
int gcd(int num1, int num2) {
  if (num1 % num2 == 0) return num2;
  return gcd(num2, num1 % num2);
}
