As we all know, blockchain technology is mostly used to develop a decentralized application.
A blockchain is a chain of connected block such that each block keeps the hash of its previous block.
You are given a list of blocks represented by pair of numbers. You have to find the maximum length that can be made by connecting these blocks.
The rule for connecting the blocks is:
Suppose a pair (x,y) is followed by (m,n). Then y must be less than m.
Print the maximum length of blockchain that can be made.
1≤n≤1051≤a,b≤105
Longest chain would be formed by (5,24), (27,40) and (50,90)