#include <bits/stdc++.h>
using namespace std;
int xa, xb, xc, xd, ya, yb, yc, yd, xcc, ycc, xdd, ydd, br=0;

int pointSq(int xa, int ya, int xb, int yb) {
    return (xa - xb) * (xa - xb) + (ya-yb) * (ya-yb);
}

bool check(int xa, int ya, int xb, int yb, int xc, int yc, int xd, int yd) {
int d2 = pointSq(xa, ya, xb, yb);
int d3 = pointSq(xa, ya, xc, yc);
int d4 = pointSq(xa, ya, xd, yd);

if (d2 == 0 || d3 == 0 || d4 == 0) {
    return false;
}

if (d2 == d3 && 2*d2 == d4 && 2 * pointSq(xb, yb, xd, yd) == pointSq(xb, yb, xc, yc)) {
    return true;
}


if (d3 == d4 && 2 * d3 == d2 && 2 * pointSq(xc, yc, xb, yb) == pointSq(xc, yc, xd, yd)) {
    return true;
}

if (d2 == d4 && 2 * d2 == d3 && 2 * pointSq(xb, yb, xc, yc) == pointSq(xb, yb, xd, yd)) {
    return true;
}
return false;
}

int main() {
cin >> xa >> ya >> xb >> yb;
int deltaX = xb - xa, deltaY = yb - ya;
xcc = xb + deltaY;
xc = xb - deltaY;

ycc = yb - deltaX;
yc = yb + deltaX;

xdd = xa + deltaY;
xd = xa - deltaY;

ydd = ya - deltaX;
yd = ya + deltaX;

//cout << xc << " " << yc << " " << xd << " " << yd << endl;
//cout << xcc << " " << ycc << " " << xdd << " " << ydd << endl;


if (check(xa, ya, xb, yb, xc, yc, xd, yd)) {
    br++;
}

else if (check(xa, ya, xb, yb, xcc, ycc, xdd, ydd)) {
    br++;
}

cout << br << endl;


return 0;
}