#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int F = 1, num = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') {
      F = -1;
    }
    c = getchar();
  }
  while (isdigit(c)) {
    num = num * 10 + c - '0';
    c = getchar();
  }
  return F * num;
}
int n, now;
int x[500];
int gcd(int a, int b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
int main() {
  n = read();
  x[1] = read();
  now = x[1];
  for (int i = 2; i <= n; ++i) {
    x[i] = read();
    now = gcd(min(now, x[i]), max(now, x[i]));
  }
  printf("%d", now * n);
  return 0;
}
