#agc052e. [agc052_e]3 Letters

[agc052_e]3 Letters

Problem Statement

A string, consisting of letters A, B, and C, is called good, if every two consecutive letters are different. For example, strings ABABAB and ABC are good, while ABBA and AABBCC aren't.

You are given two good strings SS and TT of length NN. In one operation, you can choose any letter of SS, and change it to another letter among A, B, and C, so that SS remains good.

What's the smallest number of operations needed to transform SS into TT? We can prove that it can always be done in a finite number of operations.

Constraints

  • 1leNle5cdot1051\\le N \\le 5\\cdot 10^5
  • SS is a good string of length NN consisting of A, B, and C
  • TT is a good string of length NN consisting of A, B, and C

Input

Input is given from Standard Input in the following format:

NN SS TT

Output

Output the smallest number of operations needed to transform SS into TT.


Sample Input 1

4
CABC
CBAC

Sample Output 1

6

Here is one possible sequence of operations of length 66:

CABC to\\to BABC to\\to BCBC to\\to BCAC to\\to ACAC to\\to ABAC to\\to CBAC

It can be shown that 66 operations are necessary for this case.


Sample Input 2

10
ABABABABAB
BABABABABA

Sample Output 2

15