#P8080. [COCI 2011/2012 #4] KINO
[COCI 2011/2012 #4] KINO
Description
Each row in the cinema has seats. Seats are divided into regular seats () and couple seats (). Couple seats always appear in pairs.
There is a cup holder between every two adjacent seats in the row (except between the two couple seats). In particular, there is also a cup holder at both ends of the row.
Now there are customers filling all seats. Find the maximum number of people who can use a cup holder.
Input Format
The first line contains an integer .
The second line contains characters , representing regular seats and couple seats.
Output Format
Output the maximum number of people who can use a cup holder.
3
SSS
3
4
SLLS
4
9
SLLLLSSLL
7
Hint
[Sample 3 Explanation]
If we use to represent cup holders, then the seats are as follows:
[Constraints]
- For of the testdata, .
[Hint and Notes]
This problem is translated from COCI 2011-2012 CONTEST #4 Task 1 KINO.
The score for this problem follows the original COCI settings, with a full score of .
Translated by ChatGPT 5
京公网安备 11011102002149号