#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
int main() {
  int n;
  cin >> n;
  vector<int> x(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i];
  }
  int t = gcd(x[0], x[1]);
  for (int i = 2; i < n; i++) {
    t = gcd(t, x[i]);
  }
  int ans = t * n;
  cout << ans << "\n";
}
