#include<stdio.h>
#include<math.h>
#include<ctype.h>
#include<string.h>
#include<stdlib.h>
#include<iostream>
float rastojanje(float a,float b,float c,float d)
{
	return sqrt(pow(a-c,2)+pow(b-d,2));
}

using namespace std;
main()
{
	float x1,y1,x2,y2;
	cin>>x1;
	cin>>y1;
	cin>>x2;
	cin>>y2;
	if(x1==x2)
	{
		cout<<2;
		return 0;
	}
	if(y1==y2)
	{
		cout<<2;
		return 0;
	}
	if(rastojanje(x1,y2,x2,y2)!=rastojanje(x1,y1,x1,y2))
	{
		cout<<0;
		return 0;
	}
	cout<<1;
}