#include #include #include #include #include #include #include #include using namespace std; //namaega184 int main(){ int x,y,x1,y1;scanf("%d%d%d%d",&x,&y,&x1,&y1); int ans=max(x,y);if(abs(x)==abs(y)&&!(x>0^x1>0)&&!(y>0^y1>0)&&abs(x)>abs(x1)&&abs(y)>abs(y1)&&abs(x1)==abs(y1))ans++; printf("%d\n",ans); return 0; }