eolymp
bolt
Try our new interface for solving problems

Frame

Time limit 1 second
Memory limit 64 MiB

Vasil and Peter were playing in class. On the rectangular piece of paper into the cell by Vasily linyah grid draws a line parallel to one side sheet, and a frame of rectangular shape. He whispers in my ear Peter coordinates all of the segment and the coordinates of two opposite corners of the frame, and Peter tries to quickly determine the length of the segment, once inside the frame. He is bad at, and he wrote a program that does this always correct. Write to her and you..

Input data

Let there be given through the gap 8 numbers - the coordinates of the beginning and end of the segment and the coordinates of opposite corners of the frame. Coordinates - integers, not exceeding modulo 35000.

Output data

Display single number - the length of the segment, which was within the frame.

Examples

Input example #1
4 1 9 1 2 3 5 -2
Output example #1
1
Source II этап Всеукраинской олимпиады школьников 2008-2009, г. Бердичев