400786: GYM100247 H Secret Information

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

H. Secret Informationtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Little known hacker Heaven just got access to the secret information about problems of some major programming contest. He wants to change statement of one of the problems to sabotage the contest.

For Heaven, initial and target statements are just strings of zeroes and ones. He can take any substring of initial statement and negate it — replace each zero with one, and each one with zero.

Heaven would like to leave no trace of his actions, so he wants to minimize the number of steps in turning initial statement to target.

Input

The first line contains one integer n (1 ≤ n ≤ 200000) — the length of the strings.

Then two strings of «0» and «1» follow — the binary codes of initial and target statement.

Output

Output one integer — the minimal possible number of steps.

ExamplesInput
6
101010
110011
Output
2
Input
7
1010101
0011100
Output
3

加入题单

上一题 下一题 算法标签: