33OJ
登录 注册

#ABC479B. 最长连续雨天 / Longest Rainy Streak

最长连续雨天 / Longest Rainy Streak

Problem Statement

Takahashi recorded the weather for NN consecutive days, recording each day as "sunny" or "rainy". His record is given as a string SS of length NN in the following format.

  • The ii-th character ( 1≤i≤N1 \le i \le N ) of SS represents the weather on the ii-th day from the start of the record.
    • If the ii-th character of SS is S, the record for that day was "sunny".
    • If the ii-th character of SS is R, the record for that day was "rainy".

Find the maximum number of consecutive days for which Takahashi recorded "rainy". If Takahashi never recorded "rainy", the answer is 00.

Constraints

  • NN is an integer satisfying 1≤N≤1001 \le N \le 100.
  • SS is a string of length NN consisting of S and R.

Input

The input is given from Standard Input in the following format:

  • NN
  • SS

Output

Output the answer.

7
RRSRRRS
3

Starting from the first day, Takahashi recorded rainy, rainy, sunny, rainy, rainy, rainy, sunny. "Rainy" was recorded consecutively on days 4,5,64,5,6, and there is no longer consecutive run of "rainy", so the maximum number of consecutive days with "rainy" recorded is 33.

10
SSSSSSSSSS
0

Takahashi never recorded "rainy". In this case, the answer is 00.

20
RRRSRRRRSSRRRRSRSRRR
4