program kvadrat;
var x1,x2,y1,y2:longint;

begin
readln(x1,y1);
readln(x2,y2);
if abs(x1-x2)=abs(y1-y2) then write(1)
else
begin
if y1=y2 then write(2)
else if x1=x2 then write(2)
else write(0)
end;end.