Question
String Split
Ria has a string S of length M. She wants to split it into non‑empty, consecutive pieces
S₁, S₂, …, SL
such that
-
S₁+S₂+…+SL = S
-
For every i>1, Sᵢ ≠ Sᵢ₋₁
-
L is as large as possible
Input
The first line of the input contains a single integer M.
The second line of the input contains a string S of length M.
The second line of the input contains a string S of length M.
Output
Print the maximum such integer L which satisfies the above conditions.
Example
Sample Input
6
xxyyxx
Sample Output
4
Explanation
We can divide this string into: xx, y, yx, x.
6
xxyyxx
Sample Output
4
Explanation
We can divide this string into: xx, y, yx, x.