CF137C History
Description
Polycarpus likes studying at school a lot and he is always diligent about his homework. Polycarpus has never had any problems with natural sciences as his great-great-grandfather was the great physicist Seinstein. On the other hand though, Polycarpus has never had an easy time with history.
Everybody knows that the World history encompasses exactly $ n $ events: the $ i $ -th event had continued from the year $ a_{i} $ to the year $ b_{i} $ inclusive ( $ a_{i}<b_{i} $ ). Polycarpus easily learned the dates when each of $ n $ events started and ended (Polycarpus inherited excellent memory from his great-great-granddad). But the teacher gave him a more complicated task: Polycaprus should know when all events began and ended and he should also find out for each event whether it includes another event. Polycarpus' teacher thinks that an event $ j $ includes an event $ i $ if $ a_{j}<a_{i} $ and $ b_{i}<b_{j} $ . Your task is simpler: find the number of events that are included in some other event.
Input Format
The first input line contains integer $ n $ ( $ 1
Output Format
Print the only integer — the answer to the problem.
Explanation/Hint
In the first example the fifth event is contained in the fourth. Similarly, the fourth event is contained in the third, the third — in the second and the second — in the first.
In the second example all events except the first one are contained in the first.
In the third example only one event, so the answer is 0.