#include <iostream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cmath>

using namespace std;

int main() {
    int x1, x2, y1, y2, r;
    
    if (x1 == x2) {
        r = 2;
    } else {
        if (y1 == y2) {
            r = 2;
        } else {
            if (x1 + y1 == x2 + y2) {
                r = 1;
            } else {
                if (x1 - y1 == x2 - y2) {
                    r = 1;
                } else {
                    r = 0;
                }
            }
        }
    }
    cout << r << endl;
    return 0;
}