fn main() { let mut abs = String::new(); std::io::stdin().read_line(&mut abs).ok(); let abs: Vec = abs.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let a = abs[0]; let b = abs[1]; let s = abs[2]; let mut result: isize = 0; if (a-s).abs() <= (b-s).abs() { result += (a-s).abs()+s.abs(); } else { result += (b-s).abs() + s.abs() - 1 + if a == 0 { 1 } else { a.abs() }; } if a == 0 { result += 1; } println!("{}", result); }