You are given several natural numbers. Put some of the numbers side by side according to these rules:
Write a program such that, for every given line, prints the length of the longest sequence that can be produced according to the rules above using the numbers on that line.
Input
Input consists of several lines. Each line contains a sequence of natural numbers.
Output
For each line of the input, print a line with the length of the longest sequence that can be made according to the rules given above.
Input
1 2 3 4 5 6 7 8 8 8 5 5 3 1000000 0 12 56 5 5 34 78 0 17 15 56
Output
7 2 1 0 5