CodeLab Academy 📞 9936 6696
← List Python · Level 10: Algorithms Code · 100 points ← #903 #905 →

#904. Longest increasing subsequence

Find the length of the longest strictly increasing subsequence (its elements do not have to be next to each other). ### Input The first line has n, the second line has n integers separated by spaces. ### Output A number.

Examples

Input
4
21 23 14 25
Output
3
Input
3
29 12 14
Output
2

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!