Problem: You are given two binary strings and of the same length. You can perform the following two operations on the string :
- Swap any two bits at indices and respectively (), the cost of this operation is , that is, the absolute difference between and .
- Select any arbitrary index () and flip (change to or to ) the bit at this index. The cost of this operation is .
Find the minimum cost to make the string equal to . It is not allowed to modify string .
Input Format: The first line contains a single integer () — the length of the strings and .
The second and third lines contain strings and respectively.
Both strings and have length and contain only '0' and '1'.
Output Format: Output the minimum cost to make the string equal to .
Note: In the first example, one of the optimal solutions is to flip index and index , the string changes in the following way: "100" "000" "001". The cost is .
The other optimal solution is to swap bits and indices and , the string changes then "100" "001", the cost is also .
In the second example, the optimal solution is to swap bits at indices and , the string changes as "0101" "0011". The cost is .