#!/usr/bin/env python3
from math import inf
def lis(A):
n = len(A)
L = [1] * n
for i in range(n):
for j in range(i):
if A[j] < A[i]:
L[i] = max(L[i],L[j]+1)
return max(L)
if __name__ == "__main__":
A=[5,2,8,6,7]
print(lis(A))