# Frame

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

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

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