Description
The (n) people line up in a line from left to right, and everyone faces either to the left or to the right.
The relationship between these (n) individuals is not very harmonious, so if two adjacent people are standing face to face (the one on the left is facing the right and the person on the right is facing the left), then they will have a dispute, one of them Will drive another person out of the team.
In each dispute, any two situations (the person on the left or the person on the right are kicked out of the team) may occur; and for multiple disputes that exist at the same time, they will occur in any possible order, but there will be no Two disputes occurred at the same time.
Request the minimum possible value of the number of people left in the team when the team is stable, that is, when any two people will not have a dispute.
Format
Input
The first line contains a positive integer (n), which represents the number of people.
The second line contains a string of length (n), from left to right indicating the direction of each person, where "L" means facing left and "R" means facing right.
Output
Output an integer per line, which is the smallest possible value of the remaining number of people.
Sample
Input
6
LRRLRL
Output
2
Sample Explanation
One possible way to reach 2 people is LRRLRL
→LRLRL
→LRRL
→LRL
→LR
.
Hint
Test point number | (n) | Agreement |
---|---|---|
(1,2,3) | (leq 10^6) | None |
(4,5,6) | (leq 3) | All face the same |
(7,8,9,10) | (leq 10^6) | None |
Sample Code
Code is not available!