fn main() {
    let mut abcdef = String::new();
    std::io::stdin().read_line(&mut abcdef).ok();
    let abcdef: Vec<f64> = abcdef.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); 
    let a = abcdef[0];
    let c = abcdef[2];
    let d = abcdef[3];
    let e = abcdef[4];
    let f = abcdef[5];
   
    println!("{:.06}", (((f - e) * 4.0f64 * a + (c * c + d * d))).sqrt() / 2.0f64 / a);
}