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: Accepted

Solution code:
import math
import collections
import bisect
from collections import deque
from copy import copy, deepcopy
  
def main():
    S = input()
    cnt=0
    ans=0
    for i,s in enumerate(S):
        if s=='R':
            cnt+=1
        if i==len(S)-1 or s=="S":
            ans=max(ans,cnt)
            cnt=0
    print(ans)
 
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
cnt = 0
cnt_list = []
for i in range(3):
    if S[i]=='R':
        cnt+=1
        if i == 2:
            cnt_list.append(cnt)
    else:
        cnt_list.append(cnt)
        cnt=0
print(max(cnt_list))

Submission status: Accepted

Solution code:
S=input()
Sl=list(S)
if Sl[0] == Sl[1] == Sl[2] == "R":
    print("3")
elif Sl[0] == Sl[1] == "R":
    print("2")
elif Sl[1] == Sl[2] == "R":
    print("2")
elif Sl[0] == Sl[1] == Sl[2] == "S":
    print("0")
else:
    print("1")

Submission status: Accepted

Solution code:
S = input()

if S.find("RRR") >= 0:
    print(3)
elif S.find("RR") >= 0:
    print(2)
elif S.find("R") >= 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
a=list(input())
d=0
h=0
for i in range(len(a)):
  if a[i] == 'S':
    d=0
  else:
    d+=1
    h=max(h,d)
  
print(max(d,h))

Submission status: Accepted

Solution code:
s = input()
if s.count('R') >= 1:
    if s[1] == 'S':
        print(1)
    elif s[0] == 'R' and s[1] == 'R' and s[2] == 'S':
        print(2)
    elif s[1] == 'R' and s[2] == 'R' and s[0] == 'S':
        print(2)
    elif s.count('R') == 3:
        print(3)
    elif s[1] == 'R' and s[0] == 'S' and s[2] == 'S':
        print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
S=input()
a=S.count('R')
if a==2:
    if S[1]=='S':
        print(1)
    else:
        print(2)
else:
    print(a)

Submission status: Accepted

Solution code:
# input here
_INPUT = """\
RSR
"""

def main():
    a = input()
    tenki = [b for b in a]

    if "R" not in tenki:
        print(0)
    elif tenki.count("R") == 1 :
        print(1)
    elif tenki.count("R") == 2:
        if tenki[1] == "S":
            print(1)
        else :
            print(2)
    else:
        print(3)


if __name__ == '__main__':
    import io
    import sys
    import math
    import itertools

    # sys.stdin = io.StringIO(_INPUT)
    main()

Submission status: Accepted

Solution code:
S = input()

cnt = S.count('R')

if S == 'RSR':
 print('1')
else:
 print(cnt)

Submission status: Accepted

Solution code:
s=str(input())
if s=="SRS":
  print(1)
  exit()
if "R" not in list(set(list(s))):
  print(0)
  exit()
else:
  if s[1]=="S":
    print(1)
    exit()
  else:
    if s[0]=="S" or s[2]=="S":
      print("2")
      exit()

print("3")

Submission status: Accepted

Solution code:
s=str(input())

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

Submission status: Accepted

Solution code:
S = input()
cnt = 0
M = 0
for i in range(len(S)):
    if S[i] == 'R':
        cnt += 1
    else:
        cnt = 0
    if cnt > M:
        M = cnt
print(M)

Submission status: Accepted

Solution code:
s1=input()
s=list(s1)

if s[0]=='R' and s[1]=='S' and s[2]=='R':
    print('1')
elif s[0]=='R' and s[1]=='R' and s[2]=='R':
    print('3')
elif s[0]=='R' and s[1]=='R' and s[2]=='S':
    print('2')
elif s[0]=='S' and s[1]=='R' and s[2]=='R':
    print('2')
elif s[0]=='S' and s[1]=='S' and s[2]=='S':
    print('0')  
else :
    print('1')

Submission status: Accepted

Solution code:
line = list(input())
ans = int(0)

if line[0] == "R":
	ans += 1
	if line[1] == "R":
		ans += 1
		if line[2] == "R":
			ans+=1
else:
	if line[1] == "R":
		ans += 1
		if line[2] == "R":
			ans+=1
	else:
		if line[2] == "R":
			ans+=1

print(ans)

Submission status: Accepted

Solution code:
string=input()

r=0
if string=="RRR":
	r=3
elif string=="RRS" or string =="SRR":
	r=2
elif string=='RSS' or string=='SRS' or string=='SSR' or string=='RSR':
	r=1
print(r)

Submission status: Accepted

Solution code:
s = str(input())
s = list(s)

cnt = 0

for i in range(3):
    if(s[i] == "R"):
        cnt += 1

if(s[0] == "R" and s[1] == "S" and s[2] == "R"):
    cnt = 1


print(cnt)

Submission status: Accepted

Solution code:
x,y,z = input()
if x == 'R':
    if y == 'R':
        if z == 'R':
            print('3')
        else:
            print('2')
    else:
        print('1')
elif x == 'S':
    if y == 'R':
        if z == 'R':
            print('2')
        else:
            print('1')
    elif z == 'R':
        print('1')
    else:
        print('0')

Submission status: Accepted

Solution code:
weather = input()
if weather == 'RRR':
    print(3)
elif weather == 'SRR':
    print(2)
elif weather == 'RRS':
    print(2)
elif weather == 'SSS':
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
weather = input()
raincount=0
cont=0
for  i in range(3):
    if weather[i]=="R" and cont==0:
           raincount=raincount+1
    elif weather[i]=="R" and cont==1:
           raincount=1
           cont=0
    elif weather[i] == "S":
        cont=1

print(raincount)

Submission status: Accepted

Solution code:
s = input()
ans = 0

for i in range(3):
  if s[i] == 'R':
    ans += 1
    break
    
if i == 0:
  if s[1] == 'R':
    ans += 1
    if s[2] == 'R':
      ans += 1
      
elif(i == 1):
  if s[2] == 'R':
    ans += 1
    
print(ans)

Submission status: Accepted

Solution code:
S = input()

if S =="SSS":
  print(0)
elif S[1] == "S":
  print(1)
elif S == "SRS":
  print(1)
elif S == "RRR":
  print(3)
else:
  print(2)

Submission status: Accepted

Solution code:
s=str(input())
count=0
for i in range(3):
    if s[i]=='R':
        count+=1
if count==0:
    print('0')
elif count==1:
    print('1')
elif count==2:
    if s[1]=='R':
        print('2')
    else:
        print('1')
else:
    print('3')

Submission status: Accepted

Solution code:
str1 = input()

num = str1.count('R')

if num == 3:
    print('3')
elif num == 2:
    if str1[1] == 'S':
        print('1')
    else:
        print('2')
elif num == 1:
    print('1')
else:
    print('0')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(str(input()))
import sys

if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
  print("3")

if s[0] == 'S' and s[1] == 'S' and s[2] == 'S':
  print("0")

sum = 0
for i in range(3):
  if s[i] == "R":
    sum += 1
if sum == 1:
  print("1")
elif sum == 2:
  for i in range(2):
    if s[i] == "R" and s[i+1] == "R":
      print("2")
      sys.exit()
  print("1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = tuple(input())

if S == ('R', 'R', 'R'):
    print(3)
elif S == ('R', 'R', 'S') or S == ('S', 'R', 'R'):
    print(2)
elif S == ('S', 'S', 'S'):
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
S = str(input())

if S.count('RRR') > 0:
    print(3)
elif S.count('RR') > 0:
    print(2)
elif S.count('R')>0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
climate = list(input())

rainy = climate.count('R')
sunny = climate.count('S')

if rainy == 1:
    print(1)
elif rainy == 3:
    print(3)
elif rainy == 2:
    if (climate[0] == 'R' and climate[2] == 'R'):
        print(1)
    else:
        print(2)
else:
    print(0)

Submission status: Accepted

Solution code:
S = input()

R = []
r = 0
for s in S:
    if s == "R":
        r += 1
    if s == "S":
        R.append(r)
        r = 0
    R.append(r)

print(max(R))

Submission status: Accepted

Solution code:
S=input()

if S[0]=="R":
    ans=1
    tmp=1
else:
    ans=0
    tmp=0
for i in range(1,3):
    if S[i]=="R":
        tmp+=1
        ans=max(ans,tmp)
    else:
        tmp=0
print(ans)

Submission status: Accepted

Solution code:
l = input()

if l == 'SSS':
	print(0)

elif l == 'SSR' or l == 'RSS' or l == 'SRS' or l == 'RSR':
	print(1)

elif l == 'SRR' or l == 'RRS':
	print(2)
  
elif l == 'RRR':
	print(3)

Submission status: Accepted

Solution code:
S = input()

c = S.count('R')

if ('RSR' in S):
  print(1)
else:
  print(c)

Submission status: Accepted

Solution code:
import math
a=input()
a=list(a)
b=len(a)
c=0
for i in range(int(b)):
    if(a[i]=="R"):
        c=c+1
    if(c>=1 and a[i]=="S"):
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
count=0
if('RRR'in(n)):
    print(3)
elif('RR'in(n)):
    print(2)
elif('R'in(n)):
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()


for i in s:
    if(i=='R'):
        mxcount=1
        break
    
else:
    mxcount = 0
count =1

if(len(s)>1): 
    for i in range(1,len(s)):
        if(s[i-1]=='R' and s[i]=='R'):
            count+=1
            if(mxcount<count):mxcount=count
            
        else:
            count=1
            
    print(mxcount)
    
else:
    if(s=='R'):
        print(1)
        
    else:print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
numR = 0
sunny = False
for i in range(len(S)):
    if S[i] == 'R' and not sunny:
        numR += 1
    else:
        if numR != 0:
            sunny = True
        continue


print(numR)

Submission status: Accepted

Solution code:
mozi = input()
a = list(mozi)
if a[0] == 'R' and a[1] == 'R' and a[2] == 'R':
    print(3)
elif a[0] == 'R' and a[1] == 'R':
    print(2)
elif a[1] == 'R' and a[2] == 'R':
    print(2)
elif a[0] == 'R':
    print(1)
elif a[1] == 'R':
    print(1)
elif a[2] == 'R':
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
S = input()
Ans = 0
sr = 0

for i in range(1,4):
  if S[i-1] == 'S':
    sr = 0
  else:
    sr += 1
    if sr > Ans:
      #copyつけなくていい理由を後で検証
      Ans = sr
    
print(Ans)

Submission status: Accepted

Solution code:
S = input()
if S[0] == 'R':
    if S[1] == 'R':
        if S[2] == 'R':
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    if S[1] == 'R':
        if S[2] == 'R':
              print(2)
        else:
              print(1)
    else:
        if S[2] == 'R':
              print(1)
        else:
              print(0)

Submission status: Accepted

Solution code:
n = input()
c = 0
f = False

if n[0] == "R" and n[1]=="R":
  c=2
  f = True
if n[1] == "R" and n[2] == "R":
  c=2
  f = True

if n[1] == "R" and n[0] == "R" and n[2] == "R":
  c= 3
if f == False:
  if n.count("R") == 0:
    c = 0
  else:
    c = 1

print(c)

Submission status: Accepted

Solution code:
s=list(input())
cnt=0
ans=0
for i in range(len(s)):
    if s[i]=="S":
        cnt+=1

if cnt==1 and s[1]=="S":
    ans=1
else:
    ans=3-cnt
print(ans)

Submission status: Accepted

Solution code:
a=input()
flag=False
ans=0
hold=0
for i in range(3):
    if a[i]=='R' and not flag:
        ans=1
        flag=not flag
        hold=max(hold,ans)

    elif a[i]=='R' and flag:
        ans+=1
        hold=max(hold,ans)

    else:
        ans=0
        flag=False


print(hold)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

if "RRR" in S:
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
S = input()
if not 'R' in S:
    print(0)
elif S[1] == "S":
    print(1)
else:
    print(S.count('R'))

Submission status: Accepted

Solution code:
S = input()
if 'RRR' == S:
    print(3)
elif 'RR' in S:
    print(2)
elif 'R' in S:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

s = input()
cnt = 0
ans = 0
for i in s:
    if i=='R':
        cnt += 1
    else:
        ans = max(ans,cnt)
        cnt = 0
print(max(ans,cnt))

Submission status: Accepted

Solution code:
S = str(input())

if S == "RRR":
    print(3)
elif S == "RRS" or S == "SRR":
    print(2)
elif S == "SSS":
    print(0)
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
count = 0
for i in range(3):
    if i == 0:
        if n[i] == "R":
            count+=1
    else:
        if n[i] == "R" and count == 0:
            count+=1
        elif n[i] == "R" and n[i-1] == "R" and count > 0:
            count += 1
print(count)

Submission status: Accepted

Solution code:
S = input()
M = 0
count = 0
for i in range(0,3):
  if S[i] == 'R':
    count = count + 1
    if i == 2:
      M = count
  else:
    if M < count:
      M = count
      count = 0
print(M)

Submission status: Accepted

Solution code:
import re

n = [s for s in input()]
i = 0
renzoku = 0

for j in n:
    if (j == 'R'):
        i += 1 
    else:
        if(renzoku <= i):
            renzoku = i
        i = 0

if(renzoku < i):
   renzoku = i
print(renzoku)

Submission status: Accepted

Solution code:
import numpy as np

S = np.array(list(input()))

count=0
if S[0] == "R":
    count+=1

if S[1] == "R":
    count+=1
elif S[2] == "S":
    count+=0
else:
    count=0
    
if S[2] == "R":
    count+=1
    
    
print(count)

Submission status: Accepted

Solution code:
s = list(str(input()))

def main():
    if s[0] == "R":
        if s[1] == "R":
            if s[2] == "R":
                print("3")
                return
        if s[1] == "S":
            if s[2] == "R":
                print("1")
                return
        if s[1] == "R":
            if s[2] == "S":
                print("2")
                return
        if s[1] == "S":
            if s[2] == "S":
                print("1")
                return
                
    if s[0] == "S":
        if s[1] == "R":
            if s[2] == "R":
                print("2")
                return
        if s[1] == "S":
            if s[2] == "S":
                print("0")
                return
        if s[1] == "R":
            if s[2] == "S":
                print("1")
                return
        if s[1] == "S":
            if s[2] == "R":
                print("1")
                return
        
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

cnt = 0
ans = 0
for i in range(3):
    if s[i] == 'R':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
print(ans)

Submission status: Accepted

Solution code:
w = input()
c = 1

if w=="RRR":
  print(3)
elif w=="RRS":
  print(2)
elif w=="RSR":
  print(1)
elif w=="RSS":
  print(1)
elif w=="SRR":
  print(2)
elif w=="SRS":
  print(1)
elif w=="SSR":
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
# import copy

# N = list(map(int,input().split(' ')))
# X =[input() for i in range(N[0])] 

def p(X):
    print(X)

N = input()
S = [str(c) for c in N]

count = 0

if S.count('R') >= 1:
    if S[1] == 'S':
        if S.count('R') ==2:
            count = 1
        else:
            count = 1
    else:
        count = S.count('R')

print(count)

Submission status: Accepted

Solution code:
S = input()
ans = 0
tmp = 0
for i in range(3):
  if(S[i] == "R"):
    tmp += 1
  else:
    ans = max(ans,tmp)
    tmp = 0
ans = max(ans,tmp)
print(str(ans))

Submission status: Accepted

Solution code:
s = input()

if 'RRR' in s:
    print(3)
elif 'RR' in s:
    print(2)
elif 'R' in s :
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()
c = 0
mx = 0
for i in range(len(s)):
  if s[i]=='R':
    c += 1
  else:
    if c>mx:
      mx = c
    c = 0
if c>mx:
  mx = c
print(mx)

Submission status: Accepted

Solution code:
main=input().rstrip()
count=0
flag=0
for i in range(3):
    if main[i]=='R' and flag==0:
        count+=1
    elif main[i]=='R' and flag==1:
        count=0
        count+=1
        flag=0
    else:
        flag=1
print(count)

Submission status: Accepted

Solution code:
S=input()
SL=list(S)
count = 0
if SL.count('R') == 3:
    print(3)
elif SL.count('R') ==2:
    if S.count('RR')==1:
        print(2)
    else:
        print(1)
else:
    print(SL.count('R'))

Submission status: Accepted

Solution code:
S = input()


if S[1] == "S":
    if S[0] == "R" or S[2] == "R":
        print(1)
    else:
        print(0)
else:
    if S[0] == "R" and S[2] == "R":
        print(3)
    elif S[0] == "R" or S[2] == "R":
        print(2)
    else:
        print(1)

Submission status: Accepted

Solution code:
s=input()

cnt=0
if s[0]=="R":
    cnt+=1
    if s[1]=="R":
        cnt+=1
        if s[2]=="R":
            cnt+=1


else:
    if s[1]=="R":
        cnt+=1
        if s[2]=="R":
            cnt+=1
    else:
        if s[2]=="R":
            cnt+=1
 

print(cnt)

Submission status: Accepted

Solution code:
from sys import stdin

S = stdin.readline().rstrip()

cnt = 0
tmp = 0


for x in list(S):
    if x == "R":
        tmp = tmp + 1
    elif x == "S":
        tmp = 0

    if tmp > cnt:
        cnt = tmp

print(cnt)

Submission status: Accepted

Solution code:
c = input()
c = [char for char in c]
count = 0
c1 = []
for i in c:
    if(i=='R'):
        count+=1
        c1.append(count)
    elif(i=='S'):
        count=0
        c1.append(count)
print(max(c1))

Submission status: Accepted

Solution code:
w = input()

if w == "RSR":
    print(1)

else:
    print(w.count("R"))

Submission status: Accepted

Solution code:
a = input()

if a.count("RRR") == 1:
    print (3)
elif a.count("RR") == 1:
    print (2)
elif a.count("R") == 1:
    print (1)
elif a.count("R") == 2:
    print (1)
else:
    print (0)

Submission status: Accepted

Solution code:
z=[]
a=input()
for i in a:
    z.append(i)

if (z[0]=='R') and (z[1]=='R') and (z[2]=='S'):
        print(2)
elif (z[1]=='R') and (z[2]=='R') and (z[0]=='S'):
        print(2)
elif (z[0]=='S') and (z[1]=='S') and (z[2]=='S'):
        print(0)
elif (z[0]=='R') and (z[1]=='R') and (z[2]=='R'):
        print(3)
else: 
    print(1)

Submission status: Accepted

Solution code:
S = input()

if S == 'RSS' or S == 'SRS' or S == 'SSR' or S == 'RSR':
    print(1)
elif S == 'RRS' or S == 'SRR':
    print(2)
elif S == 'RRR':
    print(3)
else:
    print(0)

Submission status: Accepted

Solution code:
text = input()
if text[1] == "S":
    if text[0] == "R" or text[2] == "R":
        print(1)
    else:
        print(0)
else:
    if text[0] == "R" and text[2] == "R":
        print(3)
    elif text[0] == "R" or text[2] == "R":
        print(2)
    else:
        print(1)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

if S == "RRR":
    print(3)
elif S == "RRS":
    print(2)
elif S == "SRR":
    print(2)
elif S == "RSR":
    print(1)
elif S == "SRS":
    print(1)
elif S == "RSS":
    print(1)
elif S == "SSR":
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()
count = s.count('R')

if count >= 2:
    if s[1] == 'R':
        print(count)
    else:
        print(1)
else:
    print(count)

Submission status: Accepted

Solution code:
S = input()

n = S.count("R")

if n == 3:
    print(3)
elif n == 0:
    print(0)
elif n == 1:
    print(1)
elif S[1]=="R":
    print(2)
else :
    print(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
n, n2 = 0, 0
for i in range(3):
  if s[i] == "R":
    n += 1
    if n2 < n:
      n2 = n
  else:
    n = 0
print(n2)

Submission status: Accepted

Solution code:
temp = str(input())
count = 0
max_count = 0 

for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    if max_count < count:
      max_count = count
    count = 0
    
print(max_count)

Submission status: Accepted

Solution code:
csl = input()
count = 0
back = 0

csl[0]

for i in range(3):
    if 'R' == csl[i]:
        count += 1

if count == 2:
    if 'S' == csl[1]:
        count = 1

print(count)

Submission status: Accepted

Solution code:
S = input()

if (S == 'RRR'):
    print(3)
elif (S == 'RRS' or S == 'SRR'):
    print(2)
elif (S == 'SSS'):
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
S = input()

if S.count("RRR") == 1 :
    print("3")
elif S.count("RR") == 1 :
    print("2")
else :
    if S.count("R") >= 1 :
        print("1")
    else :
        print("0")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

count = S.count('R')
print(count if S != 'RSR' else 1)

Submission status: Accepted

Solution code:
s=list(input())
ans=0
if s[0]=="R" :
    ans=1
    if s[1]=="R" :
        ans=2
        if s[2]=="R" :
            ans=3

elif s[0]=="S" :
    ans=0
    if s[1]=="R" :
        ans=1
        if s[2]=="R" :
            ans=2
    elif s[1]=="S" :
        ans=0
        if s[2]=="R" :
            ans=1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math

cnt = 0

S = input()
S_list = list(S)

if S_list[0] == 'R':
    SB = 'R'
else:
    SB = 'S'

for s in S_list:
    if SB == s and s == 'R':
        cnt += 1
    elif s == 'R':
        cnt = 1

    SB = s

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = list(str(input()))
for i in range(3):
    if x[i] == 'R':
        x[i] = 1
    else:
        x[i] = 0
ans = x[0] + x[1] + x[2]
if (x[0] == 1 or x[2] == 1) and x[1] == 0:
    print(1)
else:
    print(ans)

Submission status: Accepted

Solution code:
S = input()

if S[0] == "R" and S[1] == "R" and S[2] == "R":
    print(3)
elif S[0] == "R" and S[1] == "R":
    print(2)
elif S[1] == "R" and S[2] == "R":
    print(2)
elif S[0] == "R" or S[1] == "R" or S[2] == "R":
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
weather = "S" + input()
candicate = []
ans = 0
for i in range(1, 4):
  if weather[i] == "R":
    if weather[i-1] == "S":
      candicate.append(ans)
      ans = 1
    else:
      ans += 1
candicate.append(ans)
print(max(candicate))

Submission status: Accepted

Solution code:
s=list(input())
if (s[0]=='R' and s[1]=='R' and s[2]=='R'):
  print(3)
elif ((s[0]=='R' and s[1]=='R') or (s[2]=='R' and s[1]=='R')):
  print(2)
elif (s[0]=='S' and s[1]=='S' and s[2]=='S'):
  print(0)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math


if(__name__ == "__main__"):
    SSS =  input()
    if(SSS=="RRR" ):
        print(3)
    elif("RR" in SSS):
        print(2)
    elif("R" in SSS):
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
s = input()

if s == 'RRR':
  print(3)
elif s == 'SSS':
  print(0)
elif s[:2] == 'RR' or s[1:] == 'RR':
  print(2)
else:
  print(1)

Submission status: Accepted

Solution code:
l=list(input())
c=0
r=0
for i in range(len(l)):
    if l[i]=="S":
        c=0
    else:
        c+=1
        r=max(r,c)
print(max(c,r))

Submission status: Accepted

Solution code:
S = input()
count = 0

if S.count("R") == 0:
    count = 0
elif S.count("R") == 1:
    count= 1
elif S.count("R") == 2:
    if S == "RSR":
        count = 1
    else:
        count = 2
else:
    count = 3
    
print(count)

Submission status: Accepted

Solution code:
s=input()
#print(s)

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

Submission status: Accepted

Solution code:
s = input()
if s == 'RRR':
  print(3)
elif s[0:2] == 'RR' or s[1:3] == 'RR':
  print(2)
elif 'R' in s:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
S = input()
if S == "RSR":
    print(1)
else:
    print(S.count('R'))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=list(input())
if S==['S','S','R']:
    print('1')
elif S==['S','R','S']:
    print('1')
elif S==['R','S','S']:
    print('1')
elif S==['R','R','S']:
    print('2')
elif S==['R','S','R']:
    print('1')
elif S==['S','R','R']:
    print('2')
elif S==['R','R','R']:
    print('3')
else:
    print('0')

Submission status: Accepted

Solution code:
def main():
    s = list(str(input()))
    if s.count('R') == 3:
        print(3)
        return
    elif s.count('R') == 2 and s[1] == 'S':
        print(1)
        return
    elif s.count('R') == 2:
        print(2)
        return
    elif s.count('R') == 1:
        print(1)
        return
    else:
        print(0)
        return
main()

Submission status: Accepted

Solution code:
param_str = list(str(input()))

if param_str.count('R') == 2:
  if param_str[1] == 'S':
    print(1)
  else:
    print(2)
else:
  print(param_str.count('R'))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
S = list(S)

cnt = 1

if S[0]=='R' and S[1]=='R':
    cnt =2

if S[1]=='R' and S[2]=='R':
    cnt = 2

if S[1] == 'R' and S[2] == 'R' and S[0] == 'R':
    cnt = 3

if S.count('R') == 0:
    cnt = 0

print(cnt)

Submission status: Accepted

Solution code:
S = input()

if 'RRR' in S:
  count = 3
elif 'RR' in S:
  count = 2
elif 'R' in S:
  count = 1
else:
  count = 0

print(count)

Submission status: Accepted

Solution code:
S = str(input())
ind = [i for i in range(3) if S[i] == 'R']

if len(ind) == 3:
  ans = 3
elif len(ind) == 2:
  if ind == [0, 1]:
    ans = 2
  elif ind == [0, 2]:
    ans = 1
  elif ind == [1, 2]:
    ans = 2
else:
  ans = len(ind)
print(ans)

Submission status: Accepted

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

    ans = max(ans,CNT)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

if __name__ == '__main__':
	S = sys.stdin.readline().rstrip()
	if S == 'RRR':
		print('3')
	elif 'RR' in S:
		print('2')
	elif 'R' in S:
		print('1')
	else:
		print('0')

Submission status: Accepted

Solution code:
# A - Rainy Season
S = input()
ans = 0
for i in range(3):
    if S[i]=='R':
        ans += 1
if S=='RSR':
    ans = 1
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s=input()
k=s.count('R')
m=s.count('RR')
n=s.count('RRR')
if n!=0:
  print(3)
elif m!=0:
  print(2)
elif k!=0:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
S=list(input())
W=(S.count('R'))
if S[1]=='R':
  print(W)
else:
  if W==1 or W==0:
    print(W)
  else:
    print(W-1)

Submission status: Accepted

Solution code:
S = input()
if S == "RRR":
    print(3)
elif S == "RRS" or S == "SRR":
    print(2)
else:
    if "R" in S:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
S=input()
cnt=0
for i in range(len(S)):
    if S[i] == 'R':
        cnt+=1

if cnt==2:
    if S[1]=='S':
        cnt=1

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = 0

if s == "SSS":
    ans = 0
elif s == "SSR":
    ans = 1
elif s == "SRS":
    ans = 1
elif s == "SRR":
    ans = 2
elif s == "RSS":
    ans = 1
elif s == "RSR":
    ans = 1
elif s == "RRS":
    ans = 2
elif s == "RRR":
    ans = 3

print(ans)

Submission status: Accepted

Solution code:
S = list(input())
cnt = 0
if S[0] == 'R':
    if S[1] == 'R':
        if S[2] == 'R':
            cnt = 3
        else:
            cnt = 2
    else:
        cnt = 1
else:
    if S[1] == 'R':
        if S[2] == 'R':
            cnt = 2
        else:
            cnt = 1
    else:
        if S[2] == 'R':
            cnt = 1
        else:
            cnt = 0
print(cnt)