#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pb push_back
#define fi first
#define se second
#define ld long double
#define N_5 100010
#define N_6 1000010
#define N_7 10000010
#define N_8 100000010
#define N_9 1000000010
#define ost 1000000007
using namespace std;

void solve() {
    int x1,x2,y1,y2;
    cin >> x1 >> y1 >> x2 >> y2 ;
    if ( x1 == x2 || y1 == y2 ) cout << 2 ;
    else cout << 1 ;
} 
 
 
int main () {
    
    
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t =1;
    //cin >>t ;
    while(t--) 
        solve();
}