#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
using namespace std;
int main() {
int n;
long long x;
cin >> n;
int * a = new int[n];
for (int i = 0; i < n; i++)
{
cin >> a[i];
}
x = a[0];
for (int i = 1; i < n; i++)
{
x = gongbeishu(a[i], x);
}
system("pause>nul");
return 0;
}