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

int main()
{
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    double delta = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    if (delta == x1 - x2 || delta == y1 - y2 || delta == x2 - x1 || delta == y2 - y1)
        cout << 2;
    else
        cout << 1;
    return 0;
}