#include<bits/stdc++.h>
using namespace std;
int x,y,z,w;
int main(){
cin>>x>>y;
cin>>z>>w;
if(x!=z and y!=w){
    if(abs(x-z)==abs(y-w)) cout<<1<<endl;
    else cout<<0<<endl;
}
if(x==z and y!=w) cout<<2<<endl;
if(x!=z and y==w) cout<<2<<endl;

return 0;
}