P8080 [COCI 2011/2012 #4] KINO
Description
Each row in the cinema has $N$ seats. Seats are divided into regular seats ($\texttt S$) and couple seats ($\texttt L$). 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 $N$ customers filling all $N$ seats. Find the maximum number of people who can use a cup holder.
Input Format
The first line contains an integer $N$.
The second line contains $N$ characters $\texttt{S/L}$, representing regular seats and couple seats.
Output Format
Output the maximum number of people who can use a cup holder.
Explanation/Hint
**[Sample 3 Explanation]**
If we use $\texttt *$ to represent cup holders, then the seats are as follows:
$\texttt{* S * L L * L L * S * S * L L *}$
**[Constraints]**
- For $100\%$ of the testdata, $1 \le N \le 50$.
**[Hint and Notes]**
**This problem is translated from [COCI 2011-2012](https://hsin.hr/coci/archive/2011_2012/) [CONTEST #4](https://hsin.hr/coci/archive/2011_2012/contest4_tasks.pdf) _Task 1 KINO_.**
**The score for this problem follows the original COCI settings, with a full score of $50$.**
Translated by ChatGPT 5