#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int z;
  int s[101];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  int a = s[0];
  int b = s[1];
  while (a != b) {
    if (a > b)
      a -= b;
    else
      b -= a;
  }
  for (int i = 2; i < n; i++) {
    z = s[i];
    while (a != z) {
      if (a > z)
        a -= z;
      else
        z -= a;
    }
  }
  cout << n * a;
  return 0;
}
