import std.stdio;
import std.algorithm;
import std.array;
import std.conv;
import std.string;
import std.uni;
import std.range;
import std.algorithm;
import std.math;

void main()
{
    auto k = readln.strip.split(" ").map!(to!double).array;
    writeln(abs(sqrt(k[0] * k[0] + k[1] * k[1]) - sqrt(k[3] * k[3] + k[2] * k[2])));
}
