#include <iostream>
using namespace std;
int main()
{
   double a1,b1,a2,b2;
   cin>>a1; 
   cin>>b1; 
   cin>>a2; 
   cin>>b2; 
   if(a1==a2||b1==b2)
   cout<<2;
   else
   if(a1-a2==b1-b2)
   cout<<1;
   else
cout<<0;
    return 0;
}