LearnPy Hub
← Arena
IntermediateRating 1300

Longest Common Substring

Print the length of the longest string that appears as a consecutive piece in both strings.

Input

Two strings (each length ≤ 1000), one per line.

Output

One integer.

Sample 1

Input
abcdxyz
xyzabcd
Output
4

Sample 2

Input
abc
def
Output
0
solution.py
Output appears here
Longest Common Substring · Python Arena problem · LearnPy Hub