Two servers each record a compressed activity log as a string of lowercase letters. Find the length of the longest contiguous block of characters that appears, unbroken and in the same order, as a substring of both logs.
Input format
Line 1: the first log s1 (may be empty, producing a blank line).
Line 2: the second log s2 (may be empty, producing a blank line).
Both strings contain only lowercase English letters.
Output format
A single integer: the length of the longest common (contiguous) substring of s1 and s2. If the logs share no character at all, print 0.
Constraints
- 0 <= |s1|, |s2| <= 40