Given two strings and , which consist of lowercase Latin letters and digits.
Find the string of the shortest length that includes strings and as subsequences and output its length. It is allowed for the strings and to appear with gaps in the desired string, but it is important that the sequence of characters of strings and is preserved in the desired string.
The first line of the input contains the string , the second line contains the string .
The length of strings and does not exceed characters.
Output a single number – the length of the shortest string that includes strings and .
Example 1
Example 2
Example 3
Example 4