There are an integer sequence of length and an integer sequence of length .
You may perform the following operation zero or more times, in any order.
This operation can be performed on or .
If the last element is chosen, only that element is removed. There is no restriction on the values of the elements during the operations.
Find the minimum number of operations needed to make the two sequences equal in length and in all elements. Two empty sequences are also considered equal. The number of operations is the total number of operations performed on both sequences.
The input is given in the following format.
For each test case, output the minimum number of operations on a single line.
Each test case is given in the following format.
| 3 | 25 |
| 4 | 45 | No additional constraints. |