H. Hidden Message
time limit per test
3.5 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output

In class, you received a secret message scribbled on a piece of paper from one of your friends. But its content does not make sense to you. Then you remember that your friend is notoriously bad at spelling. They sometimes mix up letters, forget letters, or even add new ones. The best method to decipher the message is to guess and check. In order to make this faster, you want to write a program that does the checking for you.

Given the text from the piece of paper and a guess of what was the intended message, find the smallest number of character insertions, deletions, and replacements needed to change the intended text into the scribble you received. However, as you believe in your friends ability to get at least some things right, you expect the correct guess to require less than $$$5000$$$ edits. Thus, if the strings deviate further, your program should simply output $$$5000$$$.

Note: The timelimit on this problem is fairly tight; be careful about constant factors. In particular, we recommend avoiding dynamically sized arrays (e.g. 'std::vector') and using fixed-size arrays instead (e.g. 'std::array'). Depending on your implementation, it may be necessary to optimize out some factors of 2.

Input

The first line contains two integers $$$l_1$$$, $$$l_2$$$ ($$$1 \leq l_1, l_2 \leq 5 \cdot 10^5$$$), the lengths of the text you received and your guess, respectively.

The second line contains a string $$$s_1$$$ of length $$$l_1$$$ consisting of lower case Latin characters, the message you received.

The third line contains a string $$$s_2$$$ of length $$$l_2$$$ consisting of lower case Latin characters, your guess.

Output

Output the minimal number of edits to get from $$$s_2$$$ to $$$s_1$$$. If the answer is larger than $$$5000$$$, output $$$5000$$$ instead.

Examples
Input
5 4
abbac
abab
Output
2
Input
16 18
ltzmeatafterclas
letsmeetafterclass
Output
4
Note

For the first sample one can optain $$$s_1$$$ from $$$s_2$$$ by inserting the character 'b' in position $$$3$$$ and changing the last character from 'b' to 'c'. No sequence with fewer edits exists.

For the second sample we will remove 'e' from the second position, change 's' to 'z' and 'e' to 'a' in the appropriate positions and remove one 's' from the back of the string. No shorter edit sequence exists.