Lulu is a one-day courier on the mysterious sky islands. Lulu's job is to collect returned delivery boxes.
The people of the sky islands place returned boxes according to the following rules.
Lulu also made the following rules.
Equivalently, the sizes of the boxes on the bridges Lulu crosses must be strictly decreasing in the order of traversal.
Find the maximum number of boxes Lulu can collect in one attempt while following all rules.
The input is given in the following format.
Print the maximum number of boxes Lulu can collect while following all rules.
루루는 순서로 이동할 수 있다.
이때 회수하는 상자의 크기는 이고, 순서대로 엄격히 감소하므로 규칙을 만족한다.
is the number of islands, and is the number of bridges. The -th bridge connects islands and , and the size of the box on that bridge is .
Each line in the input represents one bridge. Multiple bridges may connect the same pair of islands.