408463: GYM103134 H The comedian Nathan
Description
The Cidade Universitária is an amazing place, with lots of trees, an Olympic streak, and, most importantly, capybaras. In addition, the campus has an extensive area, with more than $$$ 3700000m^2 $$$. To facilitate students' mobility, USP has a fleet of Circular buses, which are responsible for taking students across the campus.
Today, Nathan woke up very happy and decided to bring joy to his fellow students. Naturally, he decided to tell jokes in the Circular. Nathan understands that, in order for the person to get out of the circular happily, it cannot hear a joke more than once. In addition, there must be an interval of 5 minutes between one joke and another.
As Nathan is very friendly with the driver, he got a list with $$$N$$$ pairs $$$(e_i, s_i)$$$, the arrival and departure time of the $$$i$$$-th passenger. Note that multiple passengers can enter or leave at any given time. Furthermore, as students are almost always late, if Nathan tells a joke at the same time a passenger is leaving, that passenger will not hear the joke, however, if Nathan tells a joke at the same time someone is entering the bus, that person will hear the joke.
Due to the inherently gossipy character of college students, people who are in the Circular at the same time can share the jokes they have heard, and Nathan also wants to take that into account. Similarly, a person who is leaving cannot share a joke with a person who is entering the Circular at the same time.
To simplify things, let's assume that Nathan told his first joke at the instant $$$ t = 0 $$$, the second at $$$ t = 5 $$$, the third at $$$ t = 10 $$$, and so on. In addition, as the university does not make a point of respecting traffic laws, an unlimited number of passengers may be on the Circular at any given time. Since the Circular takes exactly 100 minutes to complete its journey, it is guaranteed that no passenger will stay in it for more than 100 minutes, except Nathan, as he is determined in his task.
With the list of the arrival and departure times of the passengers in hand, Nathan wants to prepare his repertoire of jokes. However, preparing the jokes takes time, and he doesn't want to spend more time than necessary, so he asked for your help in finding the minimum number of jokes he needs to prepare for his goal to be achieved.
InputThe first line contains an integer $$$ N $$$ $$$ (1 \leq N \leq 10 ^ 5) $$$ ─ the number of passengers in the Circular.
Following are $$$ N $$$ lines with two integers, $$$ e_i $$$ and $$$ s_i $$$ $$$ (0 \leq e_i < s_i \leq 10^9), (1 \leq s_i - e_i \leq 100) $$$ ─ the entry time and departure time of the $$$ i $$$-th passenger.
OutputPrint a single integer - the minimum amount of jokes Nathan needs to prepare for his repertoire.
ExampleInput4 2 7 8 13 6 9 21 25Output
2