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:
a = input()
b = 0
c = 'R'
d = []
for i in a:
  if i == 'R' and c == 'R':
    b = b + 1
    c = 'R'
  elif i == 'R':
    c = 'R'
    b = 1
  else:
    c = 'S'
    b = 0
  d.append(b)
e = sorted(d, reverse=True)
print(e[0])

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#coding:utf-8

a = input()

if a == "RRR":
    print("3")

elif a == "RRS" :
    print("2")

elif a == "SRR" :
    print("2")

elif a == "SRS" :
    print("1")

elif a == "RSS" :
    print("1")

elif a == "SSR" :
    print("1")

elif a == "RSR" :
    print("1")

elif a == "SSS" :
    print("0")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(s):

  res=0

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

    elif s[i]=="S" and res>0:
      return res
  return res
  
s=input()
print(solve(s))

Submission status: Accepted

Solution code:
w = input()

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

Submission status: Accepted

Solution code:
s = input().rstrip()
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:
mozi = input()
if 'RRR' in mozi:
    print(3)
elif 'RR' in mozi:
    print(2)
elif 'R' in mozi :
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
r = s.count("RRR")
n = s.count("RR")

if r == 1:
    print(3)
elif n == 1:
    print(2)
else:
    if s.count("R")>0:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
s = input()#s_1 s_2を分割して取得し、sに値を入れる
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:
elem = input()
single = elem.count("R")
double = elem.count("RR")
triple = elem.count("RRR")
if triple == 1:
    print(3)
elif double == 1:
    print(2)
else:
    if single > 0:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range;R=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def RLI(n=8,a=1,b=10):return [random.randint(a,b)for i in range(n)]
def RI(a=1,b=10):return random.randint(a,b)
def Rtest(T):
    case,err=0,0
    for i in range(T):
        inp=INP()
        a1,ls=naive(*inp)
        a2=solve(*inp)
        if a1!=a2:
            print((a1,a2),inp)
            err+=1
        case+=1
    print('Tested',case,'case with',err,'errors')
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1):
    #h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0},boundary=1) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**9)
read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()


show_flg=False
show_flg=True

ans=0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())

#print(N)

def count(list_1):
    count_2 = 0
    count_1 = 0
    for a in range(len(list_1)):
        if list_1[a] == 'R':
            count_1 += 1
        else:
            count_1 = 0
        if count_2 < count_1:
            count_2 = count_1
            #print(count_2)
    return count_2

print(count(N))

Submission status: Accepted

Solution code:
input_n = input()
n = str(input_n)

tmp = 0
result = 0

list_n = list(n)

for i in range(3):
    if list_n[i] == 'R':
        tmp += 1
    if list_n[i] == 'S':
        if tmp > result:
            result = tmp
            tmp = 0

if tmp > result:
    result = tmp
    tmp = 0

print(str(result))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

S = input()

if S == 'RRR':
    print(3)
elif S[:2] == 'RR' or S[1:3] == 'RR':
    print(2)
elif S.count('R') != 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
def main():
    import sys
    S=sys.stdin.readline().strip()
    if S=='RSR':
        print(1)
    else:
        print(S.count('R'))

main()

Submission status: Accepted

Solution code:
s = str(input())

if(s.count("RRR") == 1):
    print(3)
elif(s.count("RR") == 1):
    print(2)
elif(s.count("R") == 1 or s.count("RSR") == 1):
    print(1)
elif(s.count("SSS") == 1):
    print(0)

Submission status: Accepted

Solution code:
s = str(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:
s = input()
count = 0 
if (s == 'RRR'):
    count = 3
elif(s[:2] == 'RR' or s[1:] == 'RR'):
    count = 2
elif (s[0] == 'R' or s[1] == 'R' or s[2] == 'R'):
    count = 1
print(count)

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007

#+++++

def main():
	#a = int(input())
	#b , c = tin()
	s = input()
	r=0
	rm=0
	for c in s:
		if c == 'R':
			r+=1
			rm = max(r,rm)
		else:
			r=0
	return rm
	
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
s=[input() for i in range(0,0)]

a=S.count('RRR')
b=S.count('RR')
c=S.count('R')

if a==1:
    x=3
else:
    if b==1:
        x=2
    elif c!=0:
        x=1
    else:
        x=0

print(x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
if s.count('R')==3:
    print(3)
if s.count('R')==2:
    if s=='RSR':
        print(1)
    else:
        print(2)
if s.count('R')==1:
    print(1)
if s.count('R')==0:
    print(0)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 21:02:30 2020

@author: naoki
"""

S = input()
sq = [S[0],S[1],S[2]]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w=input()
cw={'RRR':3, 'RRS':2, 'RSR':1, 'RSS':1,
    'SRS':1, 'SSR':1, 'SRR':2, 'SSS':0 }
print(cw[w])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=str(input())
if a == 'RRR':
  print(3)
elif a == 'RRS'or a=='SRR':
  print(2)

elif a == 'RSR' or a== 'SSR' or a=='SRS' or a=='RSS':
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
s = input()

# S = 晴，R = 雨
if(s.count('R') == 0):
    print(0)
elif(s.count('R') == 1):
    print(1)
elif(s.count('R') == 3):
    print(3)
else:
    if(s[1] == 'S'):
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# coding:utf-8

temp = input()

S = list(temp)

cnt=0
max_cnt=0
tmp_s = ""
flag=0

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

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      count+=1
  print(count)

Submission status: Accepted

Solution code:
S=list(input().split("S"))
print(max(len(s) for s in S))

Submission status: Accepted

Solution code:
s = input()
x = 0
ans = 0

for w in s:
    if w == 'R':
        ans += 1
    else:
        if ans > x:
            x = ans
        ans = 0

print(max(x, ans))

Submission status: Accepted

Solution code:
S = input().strip()
c = 0
res = 0
for s in S:
    if s == 'R':
        c += 1
        res= max(res, c)
    else:
        c = 0

print(res)

Submission status: Accepted

Solution code:
s = input()
c = 0
ans = 0
for cc in s:
    if cc == "R":
        c += 1
if c <= 1:
    print(c)
elif s[1] == "S":
    print(1)
else:
    print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s.count("R") == 3:
    print(3)
elif s.count("R") == 0:
    print(0)
elif s[0] == "R" and s[1] == "R":
    print(2)
elif s[1] == "R" and s[2] == "R":
    print(2)
else:
    print(1)

Submission status: Accepted

Solution code:
S = input()

if S == "SSR" or S =="SRS" or S =="RSS" or S=="RSR":
    ans = 1
elif S =="RRR":
    ans = 3
elif S=="SSS":
    ans = 0
else:
    ans = 2

print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
table = {
    'S':'0',
    'R':'1'
}
b_S = ''.join(table.get(c, c) for c in S)

r_1 = 0
r_2 = 0
result = 0
for s in b_S:
# 連続フラグ
    if int(s) == 1 and r_1 == 1:
        r_2 = 1
    else:
        r_2 = 0
# 1出現フラグ
    if int(s) == 1:
        r_1 = 1
    else:
        r_1 = 0
# 結果を更新
    if r_2 == 1:
        result = result + 1

# '1'が出現していれば1を追加する
if '1' in b_S:
    result = result + 1
print(result)

Submission status: Accepted

Solution code:
s = input()
ans = 1 if 1 <= s.count('R') else 0

for i in range(1,3):
    if s[i-1] == s[i] and s[i] == 'R':
        ans += 1

print(ans)

Submission status: Accepted

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

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:
# -*- coding: utf-8 -*-
#天気の入力
s = str(input())
#連続したRの数を数える
rain_days = 0
max_rain_days = 0
for char in s:
    if char == 'R':
        rain_days += 1
        max_rain_days = rain_days
    elif char == 'S':
        rain_days = 0

print(max_rain_days)

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 == 'RSS':
    print("1")
elif S == 'SRS':
    print("1")
elif S == 'SSR':
    print("1")
elif S == 'SSS':
    print("0")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
from itertools import groupby
S = list(input())
print(max([len(list(v)) for k, v in groupby(S) if k == 'R']+[0]))

Submission status: Accepted

Solution code:
S=input()
set_S=set(S)
if len(set_S)==1:
    ret=S.count('R')
else:
    if S[0]==S[1]=='R' or S[1]==S[2]=='R':
        ret=2
    else:
        ret=1
print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())[:3]
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 = input()
S_list = list(S)
# print(S_list)
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:
str = input()
if 'R' in str:
   crs=1
   if 'RR' in str:
      crs=2
      if 'RRR' in str:
         crs=3
else:
    crs=0
print(crs)

Submission status: Accepted

Solution code:
S1,S2,S3 =map(str,input())
if S1 == "R"and S2 == "R" and S3 =="S":
  print(2)
elif S1 == "R" and S2 == "R" and S3=="R":
    print(3)
elif S1 == "S" and S2 == "R" and S3=="R":
    print(2)
elif S1=="S"and  S2=="S"and S3=="S":
    print(0)
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = 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:
S = input()
if S=="RRR":
    print(3)
elif S=="RRS":
    print(2)
elif S=="RSS":
    print(1)
elif S=="SSS":
    print(0)
elif S=="RSR":
    print(1)
elif S=="SRR":
    print(2)
elif S=="SSR":
    print(1)
elif S=="SRS":
    print(1)

Submission status: Accepted

Solution code:
s = list(input())
a = 0
ans = 0
for i in range(3):
    if s[i] == 'R':
        a += 1
    else:
        ans = max(a, ans)
        a = 0
ans = max(a, ans)
print(ans)

Submission status: Accepted

Solution code:
S = [s for s in input()]

S0 = S[0]
S1 = S[1]
S2 = S[2]

if S0 == S1 == S2 == 'R':
    count = 3

elif S0 == S1 == 'R' or S1 == S2 == 'R':
    count = 2

elif S0 == S1 == S2 == 'S':
    count = 0

else:
    count = 1

print(count)

Submission status: Accepted

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

Submission status: Accepted

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

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')
else:
    print('3')

Submission status: Accepted

Solution code:
def main():
    S = input()
    rs = 'R'*len(S)
    ans = 0

    for i in range(len(S)):
        if rs[0:len(rs)-i] in S:
            ans = len(S) - i
            break
  
    return ans

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
weather = input()

if weather == "RRR":
    print(3)
elif weather == "RRS" or weather == "SRR":
    print(2)
elif "R" in weather:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys

x = input()

if len(x) != 3 :
    sys.exit()

k=0

for k in range(2):
    if x[k] != "R":
        if x[k] != "S":
            print("無効な値です")
            sys.exit()
    k=k+1


i=0
if x[0]=="R":
    i = i+1
    if x[1]=="R":
        i = i+1
        if x[2]=="R":
            i = i+1
elif x[1]=="R":
    i = i+1
    if x[2]=="R":
        i = i+1
elif x[2] =="R":
    i = i+1    

print(i)

Submission status: Accepted

Solution code:
S = input()
x = 0
if S == 'RSR':
    print(1)
else:
    for i in S:
        if i == 'R':
            x += 1
    print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

cnt=0

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

if(cnt!=2):
    print(cnt)
elif(s=="RSR"):
    print(1)
else:
    print(2)

Submission status: Accepted

Solution code:
S = input()
c = 0
r = "R"
while r in S:
    c += 1
    r += "R"
print(c)

Submission status: Accepted

Solution code:
import re
S = input()
if re.search(r'R{3}', S):
  a = 3
elif re.search(r'R{2}', S):
  a = 2
elif re.search(r'R{1}', S):
  a = 1
else:
  a = 0
print(a)

Submission status: Accepted

Solution code:
S = input().strip()
print(max([len(i) for i in S.split('S')]))

Submission status: Accepted

Solution code:
s = input()

ans=0
if s[0]=='R' and s[1]=='R' and s[2]=='R':
    print(3)
elif s[1]=='R' and s[2]=='R':
    print(2)
elif s[0]=='R' and s[1]=='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:
S = input()
count = 0
if S[0] == "R" and S[1] == "R":
    if S[2] == "R":
        count = 3
    else:
        count = 2
if S[0] == "R" and S[1] == "S":
    count = 1
if S[0] == "S" and S[1] == "R":
    if S[2] == "R":
        count = 2
    else:
        count = 1
if S[0] == "S" and S[1] == "S":
    if S[2] == "R":
        count = 1
    else:
        count = 0
print(count)

Submission status: Accepted

Solution code:
A = input()
b = A.count("RRR")
C = A.count("RR")
if b == 1: 
   print(3)
elif C ==1:
   print(2)
else:
   if A.count("R")>0:
      print(1)
   else:
      print(0)

Submission status: Accepted

Solution code:
from sys import stdin,stdout
input = stdin.readline
def write(n,sep="\n"):
	stdout.write(str(n))
	stdout.write(sep)
def gil():
	return list(map(int, input().split()))

s=input()
c=0
ans=0
n=len(s)
for i in range(n):
  if s[i]=='R':
    c+=1
    ans=c
  else:
    c=0
    ans=max(ans,c)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input().split())

a = S.count('RR')
b = S.count('R')
c = S.count('RRR')

if c >= 1:
  print(3)
elif a >= 1:
  print(2)
elif b >= 1:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
S=str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
m=input()
s=list(m)
a=[]
n=len(s)
j=0
while (j<n):
    x=0
    if s[j] == 'R':
        y=j+1
        for k in range (j,n):
            y=k+1
            if s[k]=='S':
                y=k+1
                break
            else:
                x+=1
        a.append(x)
        j=y

    else:
        j+=1

a.sort(reverse=True)
if len(a)==0:
    print (0)
else:
    print(a[0])

Submission status: Accepted

Solution code:
S = str(input())

cnt = 0

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

print(cnt)

Submission status: Accepted

Solution code:
x = input()

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

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

print(cnt)

Submission status: Accepted

Solution code:
s=input()
if s.count("R")<=1:
  print(s.count("R"))
elif s.count("R")==2:
  if s[1]=="R":
    print(2)
  else:
    print(1)
else:
  print(3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = 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:
def abc175_a():
    s = input()
    cnt = 0
    result = 0

    for i in range(len(s)):
        # 雨の日。カウントを増やして、maxを残す。
        if s[i] == 'R':
            cnt += 1
            result = max(result, cnt)
        # 晴れの日。カウンタは初期化。(maxは残っている。)
        else:
            cnt = 0

    print(result)

if __name__ == '__main__':
    abc175_a()

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:
a,b,c = input()
count = 0

if a == "R" and b == "R" and c == "R":
  count = 3
elif (a == "R" and b == "R") or(b == "R" and c == "R"):
  count = 2
elif a == "R"or b =="R" or c == "R":
  count = 1
else:
  count = 0
  
print(count)

Submission status: Accepted

Solution code:
S  = list(input())
count = [0]
a = 0
for i in range(3):
    if S[i] == 'R':
        count[a] += 1
    else:
        count.append(0)
        a += 1

print(max(count))

Submission status: Accepted

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

count = 0
l = [0]

for i in range(len(s)):
    if s[i] == 'R':
        l.append(1)
        try:
            if s[i+1] == 'R':
                count += 1
                l.append(count+1)
            else:
                l.append(count)
                count = 0
        
        except IndexError:
            break

print(max(l))

Submission status: Accepted

Solution code:
S = input()

v = 0
ans = 0
for s in S:
    if s == "R":
        v += 1
        ans = max(ans, v)
    else:
        v = 0
print(ans)

Submission status: Accepted

Solution code:
s=input()
n=len(s)
c=0
li=[]
for i in range(n):
  if(s[i]=='R'):
    c=c+1
  else:
    li.append(c)
    c=0
li.append(c)
print(max(li))

Submission status: Accepted

Solution code:
s=input()
ans=0
k=0
for i in range(len(s)):
  if s[i]=='R':
    k+=1
    ans=max(ans,k)
  else:
    k=0
print(ans)

Submission status: Accepted

Solution code:
a=input()

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

Submission status: Accepted

Solution code:
s = input()
r = s.count("R")

if r == 2:
	if s[1]=="R":
		print(2)
	else:
		print(1)
else:
	print(r)

Submission status: Accepted

Solution code:
S = input()
if S.count('RRR') == 1:
    print(3)
elif S.count('R') == 2 and S.count('RR') == 1:
    print(2)
elif S.count('R') >= 1 and S.count('R') < 3 and S.count('RR') == 0:
    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()
r = 0
ans = 0
for i in range(3):
    if S[i] == 'R':
        r = r + 1
    else:
        if r > ans:
            ans = r
            r = 0
if r > ans:
    ans = r

print (ans)

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)