A subsequence of a given sequence isthegiven sequence withsome elements (possible none) left out. Given a sequence X = <x1, x2, ..., xm> another sequence Z = <z1, z2, ..., zk> is a subsequence of X if there exists a strictly increasing sequence <i1, i2, ..., ik> of indices of X such thatfor all j = 1,2,...,k, xij = zj. For example, Z = <a, b, f, c> is a subsequence of X = <a, b, c, f, b, c> with index sequence <1, 2, 4, 6>. Given two sequences X and Y the problem isto find thelengthofthe maximum-length common subsequence of X and Y.
The program input isfrom a textfile. Each data setinthefilecontains two strings representing thegiven sequences. The sequences are separated by any numberof white spaces. The input data are correct. For each setof data the program prints onthe standard output thelengthofthe maximum-length common subsequence fromthebeginningof a separate line.
Input
abcfbc abfcab
programming contest
abcd mnp
Output
420
Sample Input
abcfbc abfcab
programming contest
abcd mnp
Sample Output
420