프로그램 명: coci_kino
제한시간: 1 초

극장이 미코의 도시에 막 오픈을 했다.

극장에 있는 A 행은 N 개의 좌석을 가진다. 인접한 양 좌석 사이에 한 개의 컵 홀더가 있고 , 또한 행의 양 끝에는 컵 홀더가 있고 , 연인석 사이에는 컵 홀더가 없다.

어떤 행의 자리의 상태가 주어질 때 , 모든 좌석에 사람이 앉아있다고 가정 한 후 , 그들의 좌석 옆자리에 컵을 놓을 수 있는 최대 사람 수를 구하는 것이다.

S 는 일반석이고 L 은 연인석이고 L 은 쌍으로 나타난다.

좌석 구조가 다음과 같다면 SLLLLSSLL

* S * L L * L L * S * S * L L *
* 지점에 컵 홀더가 있고 적어도 두 명의 사람은 컵 홀더를 놓을 수 없을 것이다.
New theater just opened in Mirko’s home town, and Mirko and Slavko naturally went to check it out. Opening projection was filled to the last place, and Mirko got mad because cup-holders at both sides of his seat were taken and he had nowhere to put his Coke.

A row in theater has N seats. There is a single cup-holder between adjacent seats, and also two additional cup-holders at both ends of the row. Exception to this are pairs of love seats - there is no cup-holder between them.

Your task is to help Mirko. Given sequence of letters describing seats in some row, and assuming that all seats are taken, find the maximum number of people that can put their cups in a cup-holder right next to their seat.

Letter ‘S’ in the sequence denotes ordinary seat, and ‘L’ denotes love seat. Love seats will always come in pairs of adjacent seats.

Diagram below corresponds to sequence ‘SLLLLSSLL’, with asterixes denoting cup-holders.

* S * L L * L L * S * S * L L *
For this example, at least two persons won’t be able to put their cups into cup-holders.

입력

The first line of input contains the integer N (1 ≤ N ≤ 50), number of seats in a row. The following line contains a sequence of N letters ‘L’ or ‘S’, describing the row as stated above.

출력

The first and only line of output should contain the maximum number of people that can put their cups in cup-holder right next to them.

입출력 예

input

3
SSS

output

3

input

4
SLLS

output

4

input

9
SLLLLSSLL

output

7
출처:coci 2012 contest5 1/6

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]