a=int(input())
b=int(input())
c=int(input())
d=min(min(a,b),c)
for i in range(d,0,-1):
if a%i==0 and b%i==0 and c%i==0:
print(i)
break