Cup Holder

Time limit1sMemory limit128 MB

Problem

A theater row has N seats. There is one cup holder between every pair of adjacent seats, and there is one additional cup holder outside each end of the row.

However, the theater also has couple seats. A couple seat is a pair of adjacent seats with no cup holder between the two seats. In the seat information, S means a regular seat and L means a couple-seat position. The character L always appears as consecutive pairs.

Every seat is occupied, and each person has exactly one cup. A person can place their cup only in a cup holder immediately to the left or right of their own seat. Find the maximum number of people who can use a cup holder.

For the seat arrangement SLLLLSSLL, marking cup holders with * gives:

*S*LL*LL*S*S*LL*

In this arrangement, at least two people cannot use a cup holder.

Input

The first line contains the number of seats N. (1 <= N <= 50)

The second line contains the seat information as a string of length N.

Output

Print the maximum number of people who can place their cup in a cup holder.