You are given two sequences of integers, A and B. Write a program that finds the length of the longest common increasing subsequence of the two sequences.
A sequence S1,S2,…,Sk is an increasing subsequence of a sequence X1,X2,…,XL when both of the following hold.
A common increasing subsequence is a sequence that is an increasing subsequence of both A and B.
The two sequences are given over two lines each.
Print a single integer: the length of the longest common increasing subsequence. If no common increasing subsequence exists, print 0.