Const N=3;
var a: array[1..N] of array[1..N] of integer;
i,j,s:integer;
begin
s:=0;
for i:=1 to N do begin
for j:=1 to N do begin
readln(a[i,j]);
end;
end;
for i:=1 to N do begin
if i mod 2 = 1 then
for j:=1 to N do begin
s:=s+a[i,j];
end;
end;
writeln(s);
end.