#include <iostream>
using namespace std;
int temp;
void gcd(int x, int y){
if(x<y){
int t = x;
x = y;
y = t;
}
if(y == 0){
temp = x;
return;
}
else{
gcd(y,x%y);
return;
}
}
int main(){
int a,b,c;
cin >> a >> b >> c;
gcd(a,b);
gcd(temp,c);
cout << temp;
}