program ideone;
const 
	N=6; 
var 
	a: array [1..N] of integer;
	x, i,y,k: integer; 
begin 
	y:=MaxInt; 
	for i:= 1 to N do 
		readln(a[i]);

	for i:=1 to N-1 do 
	begin 
		x:=a[i]+a[i+1]; 
		if (x mod 2 <> 0) and (x < y) then 
			y := x;
	end;

	writeln(y)
end.