A - Rainy Season Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点 : 100

問題文

AtCoder 町の、ある連続した 3 日間の天気の記録があります。天気の記録は長さ 3 の文字列 S で表され、i (1 \leq i \leq 3) 日目の天気は i 文字目が S のとき晴れ、R のとき雨でした。

天気が雨である日が連続していた最大の日数を求めてください。

制約

  • |S| = 3
  • S の各文字は S または R である

入力

入力は以下の形式で標準入力から与えられる。

S

出力

天気が雨である日が連続していた最大の日数を出力せよ。


入力例 1

RRS

出力例 1

2

3 日間のうち、1, 2 日目が雨で、最大では 2 日間雨である日が連続していたので 2 を出力してください。


入力例 2

SSS

出力例 2

0

3 日間のうち、3 日とも晴れでした。雨である日は無かったため、0 を出力してください。


入力例 3

RSR

出力例 3

1

3 日間のうち、1, 3 日目が雨でした。共に 1 日雨である日が連続していたので、1 を出力してください。

Score : 100 points

Problem Statement

We have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.

Find the maximum number of consecutive rainy days in this period.

Constraints

  • |S| = 3
  • Each character of S is S or R.

Input

Input is given from Standard Input in the following format:

S

Output

Print the maximum number of consecutive rainy days in the period.


Sample Input 1

RRS

Sample Output 1

2

We had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.


Sample Input 2

SSS

Sample Output 2

0

It was sunny throughout the period. We had no rainy days, so we should print 0.


Sample Input 3

RSR

Sample Output 3

1

We had rain on the 1-st and 3-rd days - two "streaks" of one rainy day, so we should print 1.