program Kvadrat;

var x1, x2, y1, y2: integer;

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