use std::io::stdin; fn main() { let (a, b, c) = read_three_u32(); let second = a.max(c); let third = a.min(c); let ans = (b - second).min(second - third); println!("{}", ans); } fn read_vec_u32() -> Vec { let mut buffer = String::new(); stdin().read_line(&mut buffer).unwrap(); buffer .trim() .split_whitespace() .map(|s| s.parse().unwrap()) .collect() } fn read_three_u32() -> (u32, u32, u32) { let v = read_vec_u32(); (v[0], v[1], v[2]) }