Optimal Common Subsequence#11764

Optimal Common Subsequence

0.1 seconds
256 megabytes
Easy

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.

Input

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

Output a single number – the length of the shortest string that includes strings and .

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Example 3

Loading
Loading

Example 4

Loading
Loading