Problem3417--最长子序列

3417: 最长子序列

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

我们称一个字符串 lns="http://www.w3.org/1998/Math/MathML">S 包含字符串 lns="http://www.w3.org/1998/Math/MathML">T 是指 lns="http://www.w3.org/1998/Math/MathML">T 是 lns="http://www.w3.org/1998/Math/MathML">S 的一个子序列,即可以从字符串 lns="http://www.w3.org/1998/Math/MathML">S 中抽出若干个字符,它们按原来的顺序组合成一个新的字符串与 lns="http://www.w3.org/1998/Math/MathML">T 完全一样。

给定两个字符串 lns="http://www.w3.org/1998/Math/MathML">S 和 lns="http://www.w3.org/1998/Math/MathML">T,请问 lns="http://www.w3.org/1998/Math/MathML">T 中从第一个字符开始最长连续多少个字符 被 lns="http://www.w3.org/1998/Math/MathML">S 包含?

Input

输入两行,每行一个字符串。第一行的字符串为 lns="http://www.w3.org/1998/Math/MathML">S,第二行的字符串为 lns="http://www.w3.org/1998/Math/MathML">T。两个字符串均非空而且只包含大写英文字母。

其中,lns="http://www.w3.org/1998/Math/MathML">1TS1000

Output

输出一个整数,表示答案。

Sample Input Copy

ABCDEABCD
AABZ

Sample Output Copy

3

Source/Category