#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int n, arr[105];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  int ans = arr[0];
  for (int i = 1; i < n; i++) {
    ans = gcd(ans, arr[i]);
  }
  cout << ans * n << "\n";
  return 0;
}
