#include <bits/stdc++.h>
using namespace std;

int gcd(int a,int b){
	
  if((a%b)==0)
    return gcd(b) ;
  else
    return gcd(b,a%b);
}

int main()
{
  int a,b,c,ans;
  cin >> a >> b >> c;
  ans = gcd(a,gcd(b,c));
  
  cout << ans ;
  

return 0;
}
