Problem:


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.



Sample input:
RRS


Sample output:
2

Submission status: Runtime Error

Solution code:
s = input()

ans = 0
if s == 'RRR':
    print(3)
    exit()
elif s[0] == 'R' and s[1] == 'R':
    print(2)
    exit()
elif s[1] == 'R' and s[2] == 'R':
    print(2)
    eixt()
elif 'R' in s:
    print(1)
    exit()
else:
    print(0)

Submission status: Runtime Error

Solution code:
s = input()

if s == "SSS":
  print(0)
elif s == "SSR":
  print(1)
elif s == "SRS":
  print(1)
elif s == "SRR":
  prin(2)
elif s == "RSS":
  print(1)
elif s == "RSR":
  print(1)
elif s == "RRS":
  print(2)
elif s == "RRR":
  print(3)

Submission status: Runtime Error

Solution code:
ans = 0
answer = []
S = input()
for s in S:
    if s == "R":
        ans += 1
    else:
        answer.append(ans)
        ans = 0
print(max(answer))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
s = input()

maxs = 0
ans = []
for a in s:
    if a == 'R':
        maxs += 1
    else:
        ans.append(maxs)
        maxs = 0


print(max(ans))

Submission status: Runtime Error

Solution code:
s = list(input())
box = []
cnt = 0
for i in s:
	if i == 'R':
		cnt += 1
	else:
		box.append(cnt)
print(max(box))

Submission status: Runtime Error

Solution code:
n=list(input())
print(n.index('S'))

Submission status: Runtime Error

Solution code:
s = input()
if s == "RRS" or s=="SRR":
    print(2)
elif s == "SSR" or s == "SRS" or s == "RSS" s=="RSR":
    print(1)
elif s == "RRR":
    print(3)
else:
    print(0)

Submission status: Runtime Error

Solution code:
s = input()
num = 0
if s[0] == "R": num+=1
if s[1] == "R": num+=1
if s[2] == "R": num+=1
  print(num)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define REP(i,  n) for (int i  =  0; i < (int)(n); ++i)
#define REPR(i,  n) for (int i  =  n - 1; i >= 0; --i)
using namespace std;
#define int long long int
//------------ATCODER TEMPLATE-------------

signed main() {
  string S; cin >> S;
  int ans = 0, v = 0;
  for (int i = 0; i < 3; ++i) {
    if (S[i] == 'R') {
      ++v;
      ans = max(ans, v);
    } else {
      v = 0;
    }
  }
  cout << ans << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
S = input()
suma = 0
a = t

for s in range(len(S)):
  if s == a:
    suma += 1
  else:
    suma = 0
    a = s
    
print(suma)

Submission status: Runtime Error

Solution code:
ws = input()

rev = 0
for ch in ws:
    if ch == 'R':
        rev += 1
    else:
        rev = 0

return rev

Submission status: Runtime Error

Solution code:
s=input()
ans = 0
if "RRR" in s: ans = 3
elif "RR" in s: ans = 2
else "R" in s: ans = 1
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
def main():
    S = input().rstrip()
    CNT = 0
    ans = 0
    for c in S:
        if c == 'R':
            CNT += 1
        else:
            ans = max(ans,CNT)
            CNT = 0
    print(ans)


if __name__ == '__main__':
    main)

Submission status: Runtime Error

Solution code:
a = input()
s = 0
if a == "RRR":
  s = 3
elif a == "RRS" or a == "SRR":
  s = 2
elif a = "SSS":
  s = 0
else:
  s = 1
print(s)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#define REP(i,  n) for (int i  =  0; i < (int)(n); ++i)
#define REPR(i,  n) for (int i  =  n - 1; i >= 0; --i)
using namespace std;
#define int long long int
//------------ATCODER TEMPLATE-------------

signed main() {
  string S; cin >> S;
  int ans = 0, v = 0;
  REP(i, 3) {
    if (S[i] == 'R') {
      ++v;
      ans = max(ans, v);
    } else {
      v = 0;
    }
  }
  cout << ans << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
s = input()
if s = "SSS":
    print(0)
elif s = "RSS" or s = "SRS" or s = "SSR" or s = "RSR":
    print(1)
elif s = "RRR":
    print(3)
elif s = "RRS" or s = "SRR":
    print(2)

Submission status: Runtime Error

Solution code:
s = input()
ans = []
cnt = 0
for i in range(len(s)):
    if s[i] == "R":
        cnt += 1
    else: 
        ans.append(cnt)
        cnt = 0
print(max(ans))

Submission status: Runtime Error

Solution code:
S = input()
res = 0

if s[0] == s[1]:
  res += 1
if s[1] == s[2]:
  res += 1

print(res)

Submission status: Runtime Error

Solution code:
def solve():
    s = input()
    ans = 0
    hoge = []
    for i in s:
        if i == "R":
            ans += 1
            hoge.append(ans)
    print(min(hoge))
    return 0

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
S = input()
c = 0
cmax = 0
for c in S:
  if c == "R":
    c += 1
    if cmax < c:
      cmax = c
  else:
    c = 0
print(cmax)