Problem Statement
Snuke is playing with a board composed of infinitely many squares lining up in a row. Each square has an assigned integer; for each integer $i$, Square $i$ and Square $i+1$ are adjacent. Additionally, each square is painted white or black.
A string $s$ of length $n$ consisting of w and b represents the colors of the squares of this board, as follows:
- For each
$i = 1, 2, \dots, n$, Square$i$is white if the$i$-th character of$s$isw, and black if that character isb; - For each
$i \leq 0$, Square$i$is white; - For each
$i > n$, Square$i$is black.
Snuke has infinitely many white pieces and infinitely many black pieces. He will put these pieces on the board as follows:
- (1) Choose a piece of the color of his choice.
- (2) Among the squares adjacent to a square that already contains a piece, look for squares of the same color as the chosen piece.
- (2a) If there are such squares, choose one of them and put the piece on it;
- (2b) if there is no such square, choose a square of the same color as the chosen piece and put the piece on it.
The board initially has no piece on it.
You are given a string $t$ of length $n$ consisting of o and _. Find the minimum number of pieces Snuke needs to put on the board to have a piece on every square $i$ among Squares $1,..,n$ such that the $i$-th character of $t$ is o. It is guaranteed that $t$ has at least one occurrence of o.
Constraints
$1 \leq n \leq 10^5$$|s| = |t| = n$$s$consists ofwandb.$t$consists ofoand_.$t$has at least one occurrence ofo.
Input
Input is given from Standard Input in the following format:
n
s
t
Output
Print the minimum number of pieces Snuke needs to put on the board.
样例
3
wbb
o_o
2
4
wwww
o__o
3
9
bbwbwbwbb
_o_o_o_o_
5
17
wwwwbbbbbbbbwwwwb
__o__o_o_ooo__oo_
11
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。