var a,min: integer;
begin
readln(a);
min:=a;
while(a<>0) do begin
if(a<min) and (a mod 2<>0) then min:=a;
end;
write(min);
end.
var a,min: integer;
begin
readln(a);
min:=a;
while(a<>0) do begin
if(a<min) and (a mod 2<>0) then min:=a;
readln(a);
end;
write(min);
end.