#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;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWNvbnN0IGZsb2F0IGU9MTBlLTg7CglpbnQgeDEseTEseDIseTI7CgljaW4+PngxPj55MT4+eDI+PnkyOwoJZG91YmxlIGQsYSxiOwoJZCA9IGFicygoeTIgKiB4MSAtIHgyICogeTEpIC8gc3FydCgoeDEgLSB4MikgKiAoeDEgLSB4MikgKyAoeTEgLSB5MikgKiAoeTEgLSB5MikpKTsKCWEgPSBzcXJ0KHgxICogeDEgKyB5MSAqIHkxKTsKCWIgPSBzcXJ0KHgyICogeDIgKyB5MiAqIHkyKTsKCWludCBjb3VudD0wOwoJaWYgKCgyICogeDEgKiB4MSAtIDIgKiB4MSAqIHgyICsgMiAqIHkxICogeTEgLSAyICogeTEgKiB5MiA8IDApIG9yICgyICogeDIgKiB4MiAtIDIgKiB4MSAqIHgyICsgMiAqIHkyICogeTIgLSAyICogeTEgKiB5MiA8IDApKQoJY291bnQgPShpbnQpKG1heChhLGIpK2UpIC0gKGludCkobWluKGEsYiktZSk7CgllbHNlIHsKCQljb3VudCA9IChpbnQpKGErZSktKGludCkoZC1lKTsKCQljb3VudCA9IGNvdW50ICsgKGludCkoYitlKSAtIChpbnQpKGQtZSk7CgkJaWYgKChhYnMocm91bmQoZCkgLSBkKSA8IGUpIGFuZCAoYWJzKGQpID4gZSkpewoJCQljb3VudC0tOwoJCX0KCX0KCWNvdXQ8PGNvdW50OwoJcmV0dXJuIDA7Cn0=