LCS0 - Longest Common Subsequence


No imagination at the moment.

Input

You will be given two lines. The first line will contain the string A, the second line will contain the string B. Both strings consist of no more than 50000 lowercase Latin letters.

Output

Output the length of the longest common subsequence of strings A and B.

Example

Input

abababab
bcbb

Output

3


Added by:Sergey Kulik
Date:2012-08-25
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Folklore