Vasiliy and Petr were playing during class. On a rectangular sheet of grid paper, Vasiliy draws a segment parallel to one of the sides of the sheet, as well as a rectangular frame. He whispers to Petr the coordinates of the segment's endpoints and the coordinates of two opposite corners of the frame. Petr tries to quickly determine the length of the segment that lies inside the frame. He wasn't good at it, so he wrote a program that always determines the answer correctly. Write such a program as well.
You are given integers separated by spaces: the coordinates of the beginning and end of the segment and the coordinates of two opposite corners of the frame. Coordinates are integers with absolute values not exceeding .
Print a single number—the length of the segment that is inside the frame.
Example 1