fn main() { let mut abcd = String::new(); std::io::stdin().read_line(&mut abcd).ok(); let abcd: Vec = abcd.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let a = abcd[0]; let b = abcd[1]; let c = abcd[2]; let d = abcd[3]; let mut result = 0usize; for i in a..=b { for j in c..=d { if i != j { result += 1; } } } println!("{}", result); }