Bob got two strings, and
, which consist of only
lower case letters. For each string, there are
length of
substrings. Bob will use them to create two sets
and
. For every substring
in
, Bob can modify the consecutive suffix of
to any other characters at the cost of the length of modified suffix. The total cost is the sum of all modifications. Now Bob wants to modify the substrings in the set
so that the set
will contain exactly same substrings as the set
. Can you help Bob to find the minimum total cost?
Input Specification
The first line of input contains two integers and
(
), the number of strings and the length of each substring.
The second line of input contains one string , (
).
The second line of input contains one string , (
).
Output Specification
Output one integer, the minimal total cost to modify the set to be the set
.
Constraints
Subtask | Points | Additional constraints |
---|---|---|
No additional constraints. |
Sample Input
5 3
aabaa
ababa
Sample Output
3
Explanation for Sample
The set and
. Bob can modify
to
with a cost of
, and modify
to
with a cost of
. The total cost is
.
Comments