package main import "fmt" func main() { var a, b, c, d int fmt.Scan(&a, &b, &c, &d) if b < c { fmt.Println((b - a + 1) * (d - c + 1)) } else { ans := 0 for i := a; i <= b; i++ { for j := c; j <= d; j++ { if i != j { ans++ } } } fmt.Println(ans) } }