a,b,c,d = gets.split.map(&:to_i) ans = (b-a+1)*(d-c+1)-[0,[b-c,d-a].min+1].max puts ans