//
// main.cpp
// d057: 11494 - Queen
//
// Created by 邱柏宇 on 2019/8/14.
// Copyright © 2019 邱柏宇. All rights reserved.
//
#include <iostream>
using namespace std;
int x1,y1,x2,y2;
int main(int argc, const char * argv[]) {
while(cin>>x1>>y1>>x2>>y2){
if(x1-x2==0||y1-y2==0){
if(x1-x2==0&&y1-y2==0){
cout<<0<<endl;
}else if((x1-x2)==(y1-y2)*-1||(x1-x2)*-1==(y1-y2)) {
cout<<1<<endl;
}else if(x1-x2==0&&y1-y2!=0){
cout<<1<<endl;
}else if(x1-x2!=0&&y1-y2==0){
cout<<1<<endl;
}
}else if(x1-x2!=0||y1-y2!=0){
if((x1-x2)==(y1-y2)){
cout<<1<<endl;
}else if(x1-x2!=0&&y1-y2==0){
cout<<1<<endl;
}else if (x1-x2==0&&y1-y2!=0){
cout<<1<<endl;
}else if((x1-x2)==(y1-y2)*-1||(x1-x2)*-1==(y1-y2)){
cout<<1<<endl;
}else{
cout<<2<<endl;
}
}
}
}
//
// main.cpp
// d057: 11494 - Queen
//
// Created by 邱柏宇 on 2019/8/14.
// Copyright © 2019 邱柏宇. All rights reserved.
//
#include
using namespace std;
int x1,y1,x2,y2;
int main(int argc, const char * argv[]) {
while(cin>>x1>>y1>>x2>>y2){
if(x1-x2==0||y1-y2==0){
if(x1-x2==0&&y1-y2==0){
cout<<0<<endl;
}else if((x1-x2)==(y1-y2)*-1||(x1-x2)*-1==(y1-y2)) {
cout<<1<<endl;
}else if(x1-x2==0&&y1-y2!=0){
cout<<1<<endl;
}else if(x1-x2!=0&&y1-y2==0){
cout<<1<<endl;
}
}else if(x1-x2!=0||y1-y2!=0){
if((x1-x2)==(y1-y2)){
cout<<1<<endl;
}else if(x1-x2!=0&&y1-y2==0){
cout<<1<<endl;
}else if (x1-x2==0&&y1-y2!=0){
cout<<1<<endl;
}else if((x1-x2)==(y1-y2)*-1||(x1-x2)*-1==(y1-y2)){
cout<<1<<endl;
}else{
cout<<2<<endl;
}
}
}
}啊我忘記有0 0 0 0了.....