import sequtils, strutils var X = map(split(readline(stdin)),parseInt) var a = X[0] var b = X[1] var c = X[2] var d = X[3] var count:int=0 for i in countup(a, b): for j in countup(c, d): if i != j: count+=1 echo count