All Submissions


A magic string t of any string S is any string that can be obtained by deleting (zero or more) characters from String S. You are given two strings A and B, you need to output the length of largest magical string which can be obtained from both A as well as B.

Input

Two strings A and B on two lines, With string length(1<=len<=10^3).

Output 

Print the answer required.

Sample Input

abcdef

bcfg

Sample Output

3

Explanation:

bcf is the longest magical string that can be obtained.

 


Languages: AWK,Bash,Brain,C,C++,Java,C#,JavaScript,Pascal,Perl,PHP,Python,Python3,Ruby,Text

Time Limit: 1 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings