a = list(map(int,input().split(',')))
for i in range(min(a),0,-1):
if all(j%i==0 for j in a):
print(i)
break
# this is not the bad ans, it is not the ans for a001