import math print(math.gcd(*list(map(int,input().split()))))