Maximum Common Substring#4845

Maximum Common Substring

3 seconds
256 megabytes
Easy

Given the strings A = a_1a_2\ldots a_n and B = b_1b_2\ldots b_m.

Your task is to determine the length of the longest common substring shared by both strings.

Input

The first line contains the string and the second line contains the string . Both strings consist of lowercase Latin letters, are non-empty, and have a maximum length of characters.

Output

Print the length of the longest common substring between the two strings.

Examples

Example 1

Loading
Loading