#include <iostream>

using namespace std;
class tacka {
public:
float x;
float y;

};
int main()
{
    int br=0;
    tacka pr1, pr2, pr3, pr4,pr5,pr6;
    cin >> pr1.x >> pr1.y;
    cin >> pr2.x >> pr2.y;
    float y=pr2.y-pr1.y;
    float x=pr2.x-pr1.x;
if(pr1.x==pr1.y && pr2.x==pr2.y)
    br++;
else{
pr3.x=pr1.x-y;
pr3.y=pr1.y+x;
pr4.x=pr2.x-y;
pr4.y=pr2.y+x;
pr5.x=pr1.x+y;
pr5.y=pr1.y-x;
pr6.x=pr2.x+y;
pr6.y=pr2.y-x;
if(pr2.x-pr1.x==pr4.x-pr3.x && pr3.y-pr1.y==pr4.y-pr2.y)
br++;
if(pr2.x-pr1.x==pr6.x-pr5.x && pr2.y-pr5.y==pr2.y-pr6.y)
    br++;}
cout << br;
    return 0;
}