#include <iostream>
using namespace std;

int main()
{
    double x1,x2,y1,y2;
    int p=-1;
    cin >> x1;
    cin >> y1;
    cin >> x2;
    cin >> y2;
    if(abs(x1)==abs(x2)) p=2;
    if(abs(y1)==abs(y2)) p=2;
    if(abs(x1)==abs(x2) && abs(y1)==abs(y2)) p=0;
    if(p==-1){
        if(abs(abs(x1)-abs(x2))==abs(abs(y1)-abs(y2))) p=1; else p=0;
    }
    cout <<p;
    return 0;
}