#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
long long x1,y1,x2,y2;
int br;
scanf("%lli %lli %lli %lli",&x1,&y1,&x2,&y2);
if(x1==x2 || y1==y2) br=2;
else if(abs(y1-y2)==abs(x1-x2)) br=1;
else br=0;
if(y1==y2 && x1==x2)
    printf("Beskonacno resenja.");
else printf("%d",br);
}