Question
Match Potions
A skilled alchemist named Arjun faced a daunting challenge from his friend Sita. She presented him with two potions, Potion A and Potion B, and asked, "Can you make these two potions identical using the fewest actions possible?"
Arjun discovered that he could perform a single action by either removing the first ingredient from Potion A, as long as it isn't empty, or by removing the first ingredient from Potion B, provided it isn't empty either.
Determined to find a solution, Arjun set out to calculate the minimum number of actions required to transform the two potions into identical potions. Can you help Arjun uncover the answer?
Note: Empty Potions will be considered identical.
Input
The first line of the input will contain a single string A, representing the Potion A.
The second line of the input will contain a single string B, representing the Potion B.
Constraints
1 ≤ |A| ≤ 105
1 ≤ |B| ≤ 105
The second line of the input will contain a single string B, representing the Potion B.
Constraints
1 ≤ |A| ≤ 105
1 ≤ |B| ≤ 105
Output
Output a single Integer, representing the minimum number of actions required.
Example
Sample Input
newton
neuton
Sample Output
6
Explanation
We can achieve a minimum number of moves by removing characters ['n', 'e', 'w'] from the first string i. e. A, and ['n', 'e', 'u'] from the second string i. e. B to make both the strings identical i. e. "ton", i. e. a minimum number of operations required are 6.
newton
neuton
Sample Output
6
Explanation
We can achieve a minimum number of moves by removing characters ['n', 'e', 'w'] from the first string i. e. A, and ['n', 'e', 'u'] from the second string i. e. B to make both the strings identical i. e. "ton", i. e. a minimum number of operations required are 6.