fn main() { let stdin = std::io::read_to_string(std::io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let a: u8 = stdin.next().unwrap().parse().unwrap(); let b: u8 = stdin.next().unwrap().parse().unwrap(); let c: u8 = stdin.next().unwrap().parse().unwrap(); let d: u8 = stdin.next().unwrap().parse().unwrap(); use std::io::Write; let mut out = std::io::BufWriter::new(std::io::stdout().lock()); out.write_all(output(solve(a, b, c, d)).as_bytes()).unwrap(); } fn solve(a: u8, b: u8, c: u8, d: u8) -> u16 { (b - a + 1) as u16 * (d - c + 1) as u16 - (b.min(d) + 1).saturating_sub(a.max(c)) as u16 } fn output(ans: u16) -> String { ans.to_string() + "\n" }