Var
a, b, c: longint;
function nod(a, b: longint): longint;
begin
a := abs(a);
b := abs(b);
if a * b = 0 then nod := 1
else begin
while a <> b do
if a > b then
a := a - b
else
b := b - a;
nod := a;
end;
end;
begin
read(a, b, c);
writeln(nod(nod(a, b), c));
end.