program kvadrati;
var broj,x1,x2,y1,y2:longint;
begin
readln(x1,y1); readln(x2,y2);
if ((x1=x2) and (y1=y2)) or ((abs(x1)>1000000000) or (abs(x2)>1000000000) or (abs(y1)>1000000000) or (abs(y2)>1000000000)) then
writeln('Tacke se ne smeju podudarati i apsolutne vrednosti koordinata ne smeju biti vece od 10^9') else begin
broj:=0;
if ((x2=x1) and (y2<>y1)) or ((x2<>x1) and (y2=y1)) then broj:=2;
if (x2-x1=y2-y1) and (x2<>x1) then broj:=1;
writeln(broj); end;
readln;
end.