#include <iostream>
using namespace std;
int cmmdc(int a, int b)
{
if (a == 1 || b == 1) return 0;
int c;
while (b)
{
c = a%b;
a = b;
b = c;
}
return a;
}
int main()
{
int a, b, c, d, e;
cin >> a >> b >> c >> d >> e;
cout << cmmdc(cmmdc(cmmdc(cmmdc(a, b), c), d), e);
return 0;
}