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 .

Solution (Python):
s = input("")
Scnt = 0
Smem = 0

for i in range(len(s)):
    if s[i] == "S":
        Scnt += 1
        Smem = i

if Scnt == 3:
    print(0)
elif Scnt == 2:
    print(1)
elif Scnt == 0:
    print(3)
elif Scnt == 1 and Smem == 1:
    print(1)
elif Scnt == 1 and Smem != 1:
    print(2)

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

def B():
    n = int(input())
    a = list(map(int, input().split()))
    cnt = 0
    for i in range(n):
        for j in range(i+1, n):
            if a[i] == a[j]: continue
            for k in range(j+1, n):
                if a[i]==a[k] or a[j] == a[k]: continue
                s = a[i] + a[j] + a[k]
                if s > 2 * max(a[i], a[j], a[k]):
                    cnt += 1
    print(cnt)

def C():
    x, k, d = map(int, input().split())
    if abs(x) > k * d:
        print(abs(x) - k*d)
    else:
        tm = abs(x) // d
        x = abs(x) % d
        k -= tm
        if k % 2 == 0:
            print(x)
        else:
            print(d-x)
A()

Solution (Python):
s = input()

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

Solution (Python):
num = input()

streaks = []
streak = 0
for letter in num:
    if letter == "R":
        streak += 1
    elif letter != "R":
        streaks.append(streak)
        streak = 0
else:
    streaks.append(streak)

print(max(streaks))

Solution (Python):
s = input()
if s[0] == "R":
    if s[1] == "R":
        if s[2] == "R":
            ans = 3
        else:
            ans = 2
    else:
        ans = 1
else:
    if s[1] == "R":
        if s[2] == "R":
            ans = 2
        else:
            ans = 1
    elif s[2] == "R":
        ans = 1
    else:
        ans = 0
print(ans)

Solution (Python):
a = str(input())

if a[0] == 'R' and a[1] == 'R' and a[2] == 'R':
  print(3)
elif a[1] == 'R' and a[2] == 'R' and a[0] != 'R':
  print(2)
elif a[0] == 'R' and a[1] == 'R' and a[2] != 'R':
  print(2)
elif 'R' not in a:
  print(0)
else:
  print(1)

Solution (Python):
import re
S = input()
rds = list(map(lambda x: len(x), re.findall('R{1,}', S)))
print(max(rds)) if rds else print(0)

Solution (Python):
s=input()
ren=0
max=0
for i in range(3):
  if s[i]=="R":
    ren+=1
  else:
    ren=0
  if max<ren:
    max=ren
print(max)

Solution (Python):
s=input()
i=0
if s[i]==s[i+1]==s[i+2]=="R":
  print(3)
elif s[i]==s[i+1]=="R":
  print(2)
elif s[i+1]==s[i+2]=="R":
  print(2)
elif "R" not in s:
  print(0)
else:
  print(1)

Solution (Python):
s = input()
if(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] == 'R' or s[1] == 'R' or s[2] == 'R'):
    print(1)
else:
    print(0)

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

Solution (Python):
S=input()
count=[0]
s=0
for i in range(3):
    if S[i]=='R':
        if i==2 or S[i+1]=='S':
            s=s+1
            count.append(s)
            s=0
        else:
            s=s+1
print(max(count))

Solution (Python):
S = input()

count = 0
maximum = 0
for s in S:
  if s == 'R':
    count += 1
  else:
    count = 0
  maximum = max(maximum, count)
print(maximum)

Solution (Python):

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

Solution (Python):
S = str(input())
count = 0
result = 0
for i in S:
  if i == 'R':
    count+=1
    if count>result:
      result = count
  else:
    count=0
print(result)

Solution (Python):
w = input()

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

Solution (Python):
s = input()
count =0
fcount = 0
for i in s:
  if i=='R' and count>0:
    count = count + 1
    fcount = max(fcount,count)
  elif i=='R':
    count = 1
    fcount = 1
  else:
  	count = 0
print(fcount)

Solution (Python):
s = input()
if "R" not in s:
  print(0)
elif s[1] == "S":
  print(1)
elif s[0] == s[2] == "R":
  print(3)
elif s[0] == "R" or s[2] == "R":
  print(2)
else:
  print(1)

Solution (Python):
line = input()
rain_day = 0
k = 0
for wether in line:
  
  if wether == "R":
    rain_day += 1
  
  elif rain_day != 0:
    k = rain_day
    rain_day = 0
  
  else:
    pass
if k > rain_day:
  print(k)
else:
  print(rain_day)

Solution (Python):
n=input()

ans=0
cnt=0
for str in n:
    if str=="R":
        cnt+=1
        ans=max(ans,cnt)
    else:
        cnt=0
print(ans)

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    s = input()
    if 'RRR' in s:
        print(3)
    elif 'RR' in s:
        print(2)
    elif 'R' in s:
        print(1)
    else:
        print(0)

if __name__ == '__main__':
    main()

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

Solution (Python):
s=list(input())


c=[]
for i in range(3):
  cnt=0
  if s[i]=='R':
    
    
    while i<3:
      if s[i]=='R':
        cnt+=1
        i+=1
        
      else:
        break
        
  c.append(cnt)
    
print(max(c))

Solution (Python):
S=list(input())
count=S.count("R")
if S==["R","S","R"]:
  count=1
print(count)

Solution (Python):
S=input()
result=0
count=0
for i in S:
  if i == "R":
    count+=1
    if count>result:
      result=count
  else:
    count=0
print(result)

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

Solution (Python):
S = input()

result = 0
if "R" in S:
  if "RR" in S:
    result = S.count("R")
  else:
    result = 1

print(result)

Solution (Python):
S = input()

a = "RRR"
b = "RR"
c = "R"
    
if a == S:
    print(3)
    
elif b in S:
    print(2)

elif c in S:
    print(1)
    
else:
    print(0)

Solution (Python):
s = input()
if s in ["RRR"]:
        print(3)
if s in ["RRS",  "SRR"]:
        print(2)
if s in ["RSR", "RSS", "SRS", "SSR"]:
        print(1)
if s == "SSS":
        print(0)

Solution (Python):
s=input()

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

Solution (Python):
S = input()

flag = False
ans = 0
for i in range(len(S)):
    if S[i] == 'R':
        ans += 1
        flag = True
    elif S[i] == 'S' and flag:
        break

print(ans)

Solution (Python):
D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    S = input()
    answer = 0
    ans_list = [0]
    for i in range(3):
        if S[i] == "R":
            answer += 1
        if S[i] == "S":
            ans_list.append(answer)
            answer = 0
    ans_list.append(answer)
    print(max(ans_list))


if __name__ == "__main__":
    main()

Solution (Python):
S = 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[1] == 'R' and S[2] == 'R'):
    print(2)
elif S[0] == 'R' or S[1] == 'R' or S[2] == 'R' or (S[0] == 'R'
                                                   and S[2] == 'R'):
    print(1)
else:
    print(0)

Solution (Python):
s = input()
answer  = 0
current = 0
for ch in s:
    if ch == "R":
        current += 1
    else:
        current = 0
    answer = max(answer, current)
 
print(answer)

Solution (Python):
S = input()
n = S.count('R')

if n == 2:
    if S == 'RSR':
        print(1)
    else:
        print(2)
else:
    print(n)

Solution (Python):

flag = True
count = 0
l = []

for s in input():
    if flag:
        if s == "R":
            count += 1
            l.append(count)
        else:
            l.append(0)
            count = 0


print(max(l))

Solution (Python):
s = input()
answer  = 0
current = 0
for ch in s:
    if ch == "R":
        current += 1
    else:
        current = 0
    answer = max(answer, current)

print(answer)

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

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


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

Solution (Python):
s = input()
ans = 0
if (s[0]=='R' and s[1]=='R') and s[2]=='R':
    ans = 3
elif (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'):
    ans = 2
if ans == 0:
    for i in range(3):
        if s[i]=='R':
            ans = 1
print(ans)

Solution (Python):
s = input()
ans = 0
curr = 0
for i in range(3):
  if s[i]== "R":
    curr += 1
  else:
    ans = max(ans, curr)
    curr =0
else:
  ans = max(ans, curr)
print(ans)

Solution (Python):
S = input()

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

Solution (Python):
def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n)


if __name__ == '__main__':
    print(check_weather(input()))

Solution (Python):
def check_weather(weathers: str) -> int:
    count = weathers.count('R')
    return 1 if weathers[1] == 'S' and count == 2 else count

if __name__=='__main__':
    print(check_weather(input()))

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

Solution (Python):
S = str(input())
le = len(S)
s = []

for i in range(le):
    s.append(S[i])

r = s.count("R")

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

Solution (Python):
s = list(input())

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

print(ans)

Solution (Python):
s = input()
 
ans = 0
for i in range(0, 3):
	if s[i] == 'R':
			ans += 1
      
if ans == 2 and s[1] == 'S':
  	ans -= 1
    
print(ans)

Solution (Python):
S=input()
m=0
b=0
for s in S:
  if s == 'R':
    b+=1
    m=max(m,b)
  else:
    b=0
print(m)

Solution (Python):
s = input().strip()
res, tmp = 0, 0

for c in s:
    if c == 'R':
        tmp += 1
        res = max(res, tmp)
    else:
        tmp = 0

print(res)

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

Solution (Python):
S = input()
count = 0
mcount = 0
for i in range(len(S)):
	if(S[i] == 'S'):
		count = 0
	elif(S[i] == 'R'):
		count += 1
		if(count>mcount):
			mcount = count
print(mcount)

Solution (Python):
import sys

n = list(input())
n1 = ['R','S','R']

i = 0
cou = 0
if n == n1:
    print(1)
    sys.exit()
while i != len(n):
    if n[i] == 'R':
        cou += 1
    i += 1
print(cou)

Solution (Python):
s = input()

if s == "S" :
    print('天気が雨である日が連続していた最大の日数を入力せよ')
elif s == "RRR" :
    print(3)
elif s == "RRS" or s =="SRR" :
    print(2)
elif s == "SSS" :
    print(0)
else :
    print(1)

Solution (Python):
s = input()
n = s.count('R')

if(n==3):
    print(3)
    exit()

if(n==2):
    if(s=='RSR'):
        print(1)
    else:
        print(2)
    exit()

if(n==1):
    print(1)
else:
    print(0)

Solution (Python):
s = input()
count = 0
for i in range(3):
    if s[i] == "R":
        count += 1
    elif s[1] == "S":
        count = 0
    if s[1] == "S" and s[2] == "S" and s[0] == "R":
        count = 1
print(count)

Solution (Python):
line = input()
rain_day = 0
k = 0
for wether in line:
  
  if wether == "R":
    rain_day += 1
  
  elif rain_day != 0:
    k = rain_day
    rain_day = 0
  
  else:
    pass
if k > rain_day:
  print(k)
else:
  print(rain_day)

Solution (Python):
S=str(input())
 
if S.count('R')==0:
  print(0)
if S.count('R')==1 :
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1 and not S.count('RRR')==1:
  print(2)
if S.count('RRR')==1:
  print(3)

Solution (Python):
S=str(input())
 
if S.count('R')==0:
  print(0)
if S.count('R')==1 :
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1 and not S.count('RRR')==1:
  print(2)
if S.count('RRR')==1:
  print(3)

Solution (Python):
s = list(input())

days = 0
if s[1] == "R":
  days += 1
  if s[0] == "R":
    days += 1
  if s[2] == "R":
    days += 1
    
else:
  if s[0] == "R" or s[2] == "R":
    days = 1
    
print(days)

Solution (Python):

import sys,math

def ii(): return int(input())
def mii(): return map(int,input().split())
def lmii(): return list(mii())


def main():
    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)
        
        
      
        
    
    
    
            
        
            
    
        
if __name__=="__main__":
    main()

Solution (Python):
s = input()
if s[0] == s[1] == s[2] == "R":
    print(3)
elif s[0] == s[1] == "R" or s[1] == s[2] == "R":
    print(2)
elif s[0] == "R" or s[1] == "R" or s[2] == "R":
    print(1)
else:
    print(0)

Solution (Python):
S = input()

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

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

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

Solution (Python):
s=input()
n=0
m=0
for i in range(len(s)):
    if s[i]=='S':
        n=0
    else:
        n+=1
        m=n
print(m)

Solution (Python):
s = input()
count = 0
max = 0

for i in range(len(s)):
    if s[i] == 'S':
        count =0
    else:
        count += 1
        if count > max:
            max = count

print(max)

Solution (Python):
s=input()
l=[['SSS'],['RSS','SRS','SSR','RSR'],['RRS','SRR'],['RRR']]
for i in range(4):
  if s in l[i]:
    print(i)
    exit()

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

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    s = str(readline().rstrip().decode('utf-8'))
    if s == "RRR":
        print(3)
    elif s == "RRS" or s == "SRR":
        print(2)
    elif s.count("R") == 0:
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    solve()

Solution (Python):
n = input()

rcount = 0
m = 0
for i in n:
  if i == "R":
    rcount += 1
  else:
    rcount = 0
  
  if m <= rcount:
    m = rcount
print(m)

Solution (Python):
n = input()

rcount = 0
m = 0
for i in n:
  if i == "R":
    rcount += 1
  else:
    rcount = 0
  
  if m <= rcount:
    m = rcount
print(m)

Solution (Python):
s=str(input())
count=0
L=[]
for i in range(0,len(s)):
	if(s[i]=="R"):
		count+=1
	else:
		count=0
	L.append(count)
print(max(L))

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

Solution (Python):
s = input()
c = 0
a = 0
for i in s:
    if i == 'R':
        c += 1
        a = c
    else:
        c = 0
print(a)

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

Solution (Python):
import re

x = input()
pattern = "R+"
pat = re.search(pattern, x)
if pat:
  print(len(pat.group()))
else:
  print(0)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    S = input()
    cnt = 0
    mx = 0
    for i in range(len(S)):
        if (S[i] == 'R'):
            cnt += 1
        else:
            cnt = 0
        mx = max(mx, cnt)
    print(mx)
if __name__ == '__main__':
    main()

Solution (Python):
def main(S):
    rains = S.split('S')
    return max([len(r) for r in rains])

if __name__ == '__main__':
    S = input()
    ans = main(S)
    print(ans)

Solution (Python):
a=input()
if a=="SSS": print(0)
elif a=="RRR":print(3)
elif a in ["SSR","SRS","RSS","RSR"]:print(1)
else:print(2)

Solution (Python):
print(len(max(input().split('S'))))

Solution (Python):


from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')


def solve(S: str):
    return sum([S == "RRR", "RR" in S, "R" in S])


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    print(f'{solve(S)}')


if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):


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

Solution (Python):
s = input()
n = ans = 0
for c in s:
    if c == "S":
        n = 0
        continue
    n += 1
    if n > ans:
        ans = n
print(ans)

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

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

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

Solution (Python):
s = input()

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

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

Solution (Python):
s = input()
m = 0
temp = 0
for i in range(3):
    if s[i] == 'R':
        temp += 1
        if temp > m:
            m = temp
    else:
        if temp > m:
            m = temp
        temp = 0
print(m)

Solution (Python):
A = input()

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

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

Solution (Python):
s = list(input())

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

Solution (Python):
S = input()
 
a = (S[0] == 'R')
b = (S[1] == 'R')
c = (S[2] == 'R')
 
if a and b and c:
  print(3)
elif (a and b and (c == False)) or ((a == False) and b and c):
  print(2)
elif (a == False) and (b == False) and (c == False):
  print(0)
else:
  print(1)

Solution (Python):
S = input()

count = 0
max = 0

for i in range(3):
    if S[i] == 'R':
        count += 1
        
        if max < count:
            max = count
    else:
        count = 0

print(max)

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

Solution (Python):
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)

Solution (Python):
c = input()

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

Solution (Python):
s = input()
ans = 0
for i in range(3):
    if s[i] == "R":
        ans = 1

for i in range(2):
    if s[i:i+2] == "RR":
        ans = 2

if s == "RRR":
    ans = 3

print(ans)

Solution (Python):
s = input()
max_count = 0
count = 0
for i in s:
    if i == "R":
        count += 1
    else:
        max_count = max(max_count, count)
        count = 0
max_count = max(max_count, count)
print(max_count)

Solution (Python):
s = input()
ans = 0
a = []

for i in s:
	if i == 'R':
		ans += 1
	else :
		ans = 0
	a.append(ans)
print(max(a))

Solution (Python):
s = input()

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

Solution (Python):
a =input ()
k = 0
for i in range(3):
  if a[i]== "R":
    k=k+1
if a=="RSR":
  k=1
print (k)

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

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

Solution (Python):

    
    


import sys, os.path

if(os.path.exists('input.txt')):
    sys.stdin = open('input.txt',"r")
    

sys.setrecursionlimit(10 ** 5)

def mod(): return 10**9+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))



def solve():
    a=li();b=ans=0
    if 'R' not in a:
        print(b)
    else:
        for i in range(len(a)):
            if a[i]=='R': b+=1 ; ans=max(ans,b)
            else: b=0
        print(ans)
solve()

Solution (Python):
S = input()
count = 0
max_c = 0

for i in S:
    if i != 'R':
        count = 0
    else:
        count = count + 1
    
    if max_c < count:
        max_c = count
    
print(max_c)

Solution (Python):
a=input()
flag=0
for i in range(3):
  if(a[i]=='R'):
    flag+=1;
  
if flag==1 or flag==3 or flag==0:
  print(flag)
elif flag==2 and a[1]=='R':
  print(flag)
else:
  print(1)

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

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

Solution (Python):
S=input().split("S")
print(len(max(S)))

Solution (Python):
s=input().split("S")

print(len(max(s)))

Solution (Python):
s = input()

ans = 0
for ch in s:
    if ch == 'R':
        ans += 1

if ans == 2 and s[1] == 'S':
    print(1)
else:
    print(ans)

Solution (Python):
S=input()
if ("R" in S) and ("RR" not in S) and ("RRR" not in S):
  print(1)
elif ("RR" in S) and ("RRR" not in S):
  print(2)
elif ("RRR" in S):
  print(3)
else:
  print(0)

Solution (Python):
S = input()


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

    
print(ans)

Solution (Python):
S = input()

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

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

Solution (Python):
import math
import collections
import itertools

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

resolve()

Solution (Python):
s = input()
count = 0
for i in range(3):
  if s[i] == 'R':
    count+=1
if count <= 1 or count == 3:
  print(count)
elif s[1] != 'R':
  print(count-1)
else:
  print(count)

Solution (Python):
data = input()

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

Solution (Python):
S = input()

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

Solution (Python):
s = input()
ans = 0

if "RRR" == s:
    ans = 3
elif "RR" in s:
    ans = 2
elif "R" in s:
    ans = 1

print(ans)

Solution (Python):

def main():
    s = input()
    if s[1] == "S":
        if s[0] == "R" or s[2] == "R":
            print(1)
        else:
            print(0)
    else:
        count = 0
        for i in range(3):
            if s[i] == "R":
                count += 1
        print(count)

if __name__ == '__main__':
    main()

Solution (Python):
S = input()

if "RRS" in S or "SRR" in S:
    print(2)

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

elif "RRR" in S: 
    print(3)

else:
    print(1)

Solution (Python):
s = input()

if s == "SSS":
    print("0")

elif s == "RRS" or s == "SRR":
    print("2")

elif s == "RRR":
    print("3")

else:
    print("1")

Solution (Python):
S = input()
 
 
D = S.count("R")
 
if D == 1:
    print(1)
 
elif D == 3:
    print(3)
 
elif D == 2:
    for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
 
elif D == 0:
    print(0)

Solution (Python):
S = input()



con = S.count("R")

if con == 1:
    print(1)

elif con == 3:
    print(3)

elif con == 2:
    for j in range(3):
        if S[j] =="R":
            if S[j+1] =="R":
                print(2)
                break

            else:
                print(1)
                break

elif con == 0:
    print(0)

Solution (Python):
s = input()

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

Solution (Python):
s=input()

a="RRR"
b="RR"
c="R"


if a in s:
    print(3)
elif b in s:
    print(2)
elif c in s:
    print(1)
else:
    print(0)

Solution (Python):
s = input()

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

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

print(ans)

Solution (Python):
S = input()

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

Solution (Python):
s = input()
c = s.count('R')
if c == 2 and s[1] == 'S':
    c = 1
print(c)

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

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

Solution (Python):
S = input()
sum = 0
for i in range(3):
    if S[i]=="R":
        sum += 1
if sum == 2 and S[1] == "S":
        sum = 1
print(sum)

Solution (Python):
D = list(input())
ans = 0
cnt = 0

for i in D:
  if i == 'R':
    cnt += 1
  else:
    cnt = 0
  if ans < cnt:
    ans = cnt
print(ans)

Solution (Python):

S = input()
ans  = [0]
cnt = 0
for i in S:
    if i =="S":
        ans.append(cnt)
        cnt = 0
    else:
        cnt+=1
print(max(max(ans),cnt))

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

print(ans)

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

Solution (Python):
s = input()
ans = 0
for r in s:
    if r == 'R':
        ans += 1
if ans == 2 and s == 'RSR':
    print(1)
else:
    print(ans)

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

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

Solution (Python):
s = input()
map = {'SSS': 0, 'SSR': 1, 'SRS': 1, 'RSS': 1, 'SRR': 2, 'RSR': 1, 'RRS': 2, 'RRR': 3}
for key in map.keys():
    if s == key:
        print(map[key])
        break

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

Solution (Python):
A = input()

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