If we regard the fence as a one-dimensional number line, Farmer John paints the interval between x=ax=a and x=bx=b. For example, if a=3a=3 and b=5b=5, then Farmer John paints an interval of length 2. Bessie, misunderstanding Farmer John's instructions, paints the interval from x=cx=c to x=dx=d, which may possibly overlap with part or all of Farmer John's interval. Please determine the total length of fence that is now covered with paint.
The first line of the input contains the integers aa and bb, separated by a space (a<ba<b).
The second line contains integers cc and dd, separated by a space (c<dc<d).
The values of aa, bb, cc, and dd all lie in the range 0…1000…100, inclusive.
Please output a single line containing the total length of the fence covered with paint.