题目描述
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
输入格式
见题面
输出格式
见题面
样例输入
10 90 20 80
样例输出
60