Milly and her friends are playing a game in which there is a straight rope that is fitted from both the sides between two walls. Now say leftmost endpoint is at 0-th coordinate and rightmost is at M-th coordinate. According to this game, every player Pi will attach balloons at each index in their particular segment [Li, Ri]. But the problem is that one part of any segment can belong to multiple players. Milly wants to know the number of indexes in her assigned segment that are disjoint to any other's segment.
Note : Starting (0) and ending (M) indexes of the rope can be used if comes in any of the segment.
She can use 0, 1, 2 coordinates to attach her own balloons disjointly.