#include using namespace std; typedef long long ll; #define rep(i,n) for(int i=0;iP; int main(){ ll a,b,c,d; cin>>a>>b>>c>>d; if(a==c||b==d||(abs(a-c)==1 && abs(b-d)<=2)||(abs(a-c)<=2 && abs(b-d)==1)){ cout<<1<