A, B, C, D = gets.split.map &:to_i p (B - A + 1) * (D - C + 1) - [0, [B, D].min - [A, C].max + 1].max