#include <bits/stdc++.h>
using namespace std;

int x1,x2,yy1,y2;
int main() {
cin>>x1>>yy1;
cin>>x2>>y2;

if(x1==x2 or yy1==y2)
cout<<2<<endl;
else if(x2-x1==y2-yy1)
cout<<1<<endl;
else cout<<0;
  return 0;
}