p03632 AtCoder Beginner Contest 070 - Two Switches
Alice and Bob are controlling a robot. They each have one switch that controls the robot.
Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up.
Bob started holding down his button C second after the start-up, and released his button D second after the start-up.
For how many seconds both Alice and Bob were holding down their buttons?

Constraints

* 0≤A<B≤100
* 0≤C<D≤100
* All input values are integers.

Input

Input is given from Standard Input in the following format:


A B C D


Output

Print the length of the duration (in seconds) in which both Alice and Bob were holding down their buttons.

Examples

Input

0 75 25 100


Output

50


Input

0 33 66 99


Output

0


Input

10 90 20 80


Output

60
```python
a,b,c,d=map(int,input().split())
print(max(0,min(d,b)-max(a,c)))
```