#include <iostream>
#include <cmath>
using namespace std;

int main() {
	const float e=10e-8;
	int x1,y1,x2,y2;
	cin>>x1>>y1>>x2>>y2;
	double d,a,b;
	d = abs((y2 * x1 - x2 * y1) / sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)));
	a = sqrt(x1 * x1 + y1 * y1);
	b = sqrt(x2 * x2 + y2 * y2);
	int count=0;
	if ((2 * x1 * x1 - 2 * x1 * x2 + 2 * y1 * y1 - 2 * y1 * y2 < 0) or (2 * x2 * x2 - 2 * x1 * x2 + 2 * y2 * y2 - 2 * y1 * y2 < 0))
	count =(int)(max(a,b)+e) - (int)(min(a,b)-e);
	else {
		count = (int)(a+e)-(int)(d-e);
		count = count + (int)(b+e) - (int)(d-e);
		if ((abs(round(d) - d) < e) and (abs(d) > e)){
			count--;
		}
	}
	cout<<count;
	return 0;
}