#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int n, num[105], ans;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> num[i];
  sort(num + 1, num + 1 + n);
  ans = num[1];
  for (int i = 2; i <= n; i++) ans = gcd(ans, num[i]);
  printf("%d\n", ans * n);
}
