#include <bits/stdc++.h>

auto main() -> int {
	using i64 = long long;

	std::ios_base::sync_with_stdio(false);

	i64 x1, y1, x2, y2;

	std::cin >> x1 >> y1 >> x2 >> y2;

	std::cout << (x1 == x2 || y1 == y2 ? "2\n" : "1\n");
}