#include <bits/stdc++.h> using namespace std; int main() { long long a, b, c, d; cin >> a >> b; cin >> c >> d; if (a!=c || a!=d || b!=a || b!=d) cout<<"1"; else if(a==c && a==d && b==c && b==d) cout<<"2"; else cout<<"3"; }