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