A "Sorting" algorithm
Python 2, length 14 12 10 9



M=max;X=exit;i=input();L=[0]*M(i)
for&#9;a&#9;in&#9;i:L[a-1]=M(L[:a])+1
X(M(L))


Output is via exit code.

Try it online!

How it works

At all times, the array \$L\$ keeps track of the longest sorted subarrays encountered so far; \$L[a-1]\$ is the length of longest one that ends with \$a\$.

Initially, we haven't processed an array elements, so \$L\$ consists entirely of zeroes.

When processing the array element \$a\$, we first take the maximum of \$[L[0], \dots, L[a-1]]\$, which is length of the longest sorted subarray encountered so far that ends with \$a\$ or a smaller integer. Appending \$a\$ to such an array will keep it sorted, so the longest sorted subarray ending in \$a\$ is one element longer than that maximum. We update \$L[a-1]\$ with the computed value.

The final result is the maximum of \$L\$.