peterverebics/CodeNet_Python_118 huggingface dataset:
tenki = input()

if tenki == "RRR":
    print("3")
elif tenki == "RRS":
    print("2")
elif  tenki == "RSR":
    print("1")
elif tenki == "RSS":
    print("1")
elif tenki == "SRR":
    print("2")
elif tenki == "SRS":
    print("1")
elif tenki == "SSR":
    print("1")
elif tenki == "SSS":
    print("0")
input1 = str(input())

if input1 == "SSS":
    print("0")
    
if input1 == "SSR":
    print("1")
    
if input1 == "SRS":
    print("1")
    
if input1 == "RSS":
    print("1")
    
if input1 == "RRS":
    print("2")
    
if input1 == "RSR":
    print("1")
    
if input1 == "SRR":
    print("2")
    
if input1 == "RRR":
    print("3")
s = str(input())
count = []
x = 0 
for i in range(len(s)):
    if s[i] == "R":
        x += 1
        if i == len(s)-1:
            count.append(x)
    if s[i] == "S":
        count.append(x)
        x = 0

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

if S=="RSR":
    cnt+=1
else:
    for c in S:
        if c=='R':cnt+=1
    
print(cnt)
# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	S = input()
	cnt = 0
	val = 0
	for i in S:
		if i != "S":
			val += 1
			cnt = max(val, cnt)
		else:
			cnt = max(val, cnt)
			val = 0

	cnt = max(val, cnt)
	print(cnt)


	




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

if S == 'RRR':
  print(3)
elif 'RR' in S:
  print(2)
elif 'R' in S:
  print(1)
else:
  print(0)
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 == "SSR":
    print(1)
elif S == "RSS":
    print(1)
else:
    print(0)
s=input()
if 'RRR' in s:
  print(3)
elif 'RR' in s:
  print(2)
elif 'R' in s:
  print(1)
else:
  print(0)
ans = 0
s = input()
if 'RRR' == s:
  ans = 3
elif 'RR' in s:
  ans = 2
elif 'R' in s:
  ans = 1
print(ans)
S=input()
ans=0
if "RRR" in S:
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)
a=input()
if a=='RRR':
  print(3)
elif a=='SRR' or a=='RRS':
  print(2)
elif a=='SSS':
  print(0)
else:
  print(1)
s=input()
c1="RRR"
c2="RR"
c3="R"
if c1 in s:
    print(3)
elif c2 in s:
    print(2)
elif c3 in s:
    print(1)
else:
    print(0)
s = input()
if 'RRR' in s:  print(3)
elif 'RR' in s: print(2)
elif 'R' in s:   print(1)
else:   print(0)
s = input()
cnt = 0
for x in range(2):
    if s[x] == 'R' and s[x+1] == 'R':
        cnt += 1

for x in s:
    if x == 'R':
        cnt += 1
        break

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

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

count = 0
max_count =0
for i in range(3):
    if a[i] == "S":
        count = 0
    elif a[i] == "R":
        count = count + 1
    if max_count <count:
        max_count = count

print(max_count)
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)
import sys
import copy
from collections import deque
import collections
stdin = sys.stdin

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

s = ns()

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

if s[0]==s[1]=='R' or s[1]==s[2]=='R':
    print(2)
    exit(0)

if 'R' in s:
    print(1)
    exit(0)

print(0)
s = input()
cnt = 0
for i in range (3):
    if s[i] == 'R':
        cnt += 1
if cnt == 3:
    print(3)
elif cnt == 2:
    if s[1] == 'S':
        print(1)
    else:
        print(2)
else:
    print(cnt)
S = input()
if S.count("RRR"):  print(3)
elif S.count("RR"):  print(2)
elif S.count("R"):  print(1)
else:  print(0)
S=input()

R=0
Rmax=0
for i in range(3):
    if S[i] == 'R':
        R+=1
    else:
        if R > Rmax:
            Rmax = R
        R=0
if R > Rmax:
    Rmax = R

print(Rmax)
import sys
# sys.setrecursionlimit(10**6)
# input = sys.stdin.buffer.readline
# arr = [[int(el) for el in input().split()] for i in range(n)]

s = input()

def sol(s):

    if s == "RRR":
        return 3

    # print (s, s[0], s[1], s[2])

    if (s[0] == s[1] == "R") or (s[1] == s[2] == "R"):
        return 2

    if "R" in s:
        return 1

    return 0

print (sol(s))
S = input()
count = 0
ans = 0
for i in S:
    if i == "R":
        count += 1
        ans = max(ans,count)
    else:
        count = 0
print(ans)
S = input()

if 'RRR' in S:
  print(3)
elif 'RR' in S:
  print(2)
elif 'R' in S:
  print(1)
else:
  print(0)
W = input()
if "RRR" in W:
	print(3)
elif "RR" in W:
  	print(2)
elif "R" in W:
  	print(1)
else:
  	print(0)
str1 = input()
if str1 == 'RRR':
    print(3)
elif str1 == 'SSS':
    print(0)
else:
    for i in range(len(str1) - 1):
        if str1[i] == str1[i+1] == 'R':
            flag = 0
            break
        else:
            flag = 1
    if flag == 0:
        print(2)
    else:
        print(1)
#import 
s=input()
#=int(input())
#=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

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

count = 0
for i in range(3):
    if s[i] == 'R':
        count += 1
    else:
        l.append(count)
        count = 0
l.append(count)

print(max(l))
s = input()

if s == 'RRR':
    print(3)
elif s == 'SSS':
    print(0)
elif s in ['RRS','SRR']:
    print(2)
else:
    print(1)
s = input()
if s=='RRR':
  print(3)
elif 'RR' in s:
  print(2)
elif 'R' in s:
  print(1)
else:
  print(0)
a = input()
emp = 0
l = a.split('S')
while("" in l):
   l.remove("")
if not l:
   print(emp)
else:
   print(len(l[0]))
s=input()
flag=False
ans=0
for i in range(3):
    if s[i]=="R":
        ans+=1
        if not flag:
            flag=True
    if s[i]=="S" and flag:
        break
print(ans)
array=input()
r=0
checker=[]
for i in array:
	if i=='R':
		r+=1
	else:
		checker.append(r)
		r=0
checker.append(r)
print(max(checker))
w=input()
cw={'RRR':3, 'RRS':2, 'RSR':1, 'RSS':1,
    'SRS':1, 'SSR':1, 'SRR':2, 'SSS':0 }
print(cw[w])
s=list(input())
cnt = 0
ans = 0
for i in s:
  if i == "R":
    cnt += 1
  else:
    cnt = 0
  ans = max(ans,cnt)
print(ans)
S=input()
print(3 if S=="RRR" else 2 if "RR" in S else 1 if "R" in S else 0)
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)
S=input()
ans=0
if 'R' in S:
    ans+=1
for i in range(2):
    if S[i]==S[i+1]=='R':
        ans+=1
print(ans)
S = input()

r = S.count("R")

if S == "RSR":
    r -= 1

print(r)
s = input()
ans = 0
p = 0
for i in range(3):
    if s[i] == 'R':
        p += 1
    else:
        ans = max(ans,p)
        p = 0
print(max(ans,p))
S = input()
if S =="RSR":
    print(1)
    exit()
print(S.count("R"))
S = input()
if (S == 'RRR'):
    print(3)
    exit()
elif ('RR' in S):
    print(2)
    exit()
elif ('R' in S):
    print(1)
else:
    print(0)
S=input()
if S=="RRR":
    print(3)
elif S=="RRS" or S=="SRR":
    print(2)
elif S=="RSS" or S=="SRS" or S=="SSR" or S=="RSR":
    print(1)
else:
    print(0)
S = str(input())
if S == "RRR":
    print(3)
elif S == "RRS":
    print(2)
elif S == "SRR":
    print(2)
elif S=="SSS":
    print(0)
else:
    print(1)
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)
s = input()
if s.count('SSS')==1:
  ans = 0
elif s.count('RRR') == 1:
  ans = 3
elif s.count('RR') == 1:
  ans = 2
else:
  ans = 1
  
print(ans)
s = input()
if 'RRR' in s:
    res = 3
elif 'RR' in s:
    res = 2
elif 'R' in s:
    res = 1
else:
    res = 0
print(res)
S=input()
ans = 0
if("RRR" == S) :
    ans = 3
elif("RR" in S) :
    ans = 2
elif("R" in S) :
    ans = 1
else :
    ans = 0
print(ans)
import sys
input = sys.stdin.readline
def inps():
    return str(input())
def longest(s):
    max_now = 0
    max_glo = 0
    for i in range(len(s)):
        if s[i] == "R": max_now+=1
        else: max_now = 0
        if max_glo<max_now: max_glo=max_now
    return max_glo    

s = inps().rstrip()
print(longest(s))
s=input()
c=0
tmp=0
for i in range(3):
    if s[i]=='R':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0
print(c)
S = input()

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

print(result)
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)
S=input()
suc=0
ans=0
for i in range(3):
    if S[i]=='R':
        suc+=1
        ans=max(ans,suc)
    else:
        suc=0
print(ans)
S = input()
ls = []
now = 0
for i in range(3):
    if S[i] == "R":
        now += 1
    else:
        ls.append(now)
        now = 0
ls.append(now)
print(max(ls))
s = input()
if s == "RRR":
    print(3)
elif s[0] == "R" and s[1] != "R":
    print(1)
elif s[2] == "R" and s[1] != "R":
    print(1)
elif s[1] == "R" and s[0] != "R" and s[2] != "R":
    print(1)
elif s[0] == "R" and s[1] == "R":
    print(2)
elif s[1] == "R" and s[2] == "R":
    print(2)
else:
    print(0)
S = input()
if S == "RRR":
    print(3)
elif S.count("RR") >= 1:
    print(2)
elif S.count("R") >= 1:
    print(1)
else:
    print(0)
a1 = input()

count = 0
max = 0
for i in a1:
  if i == "R":
    count += 1
    max = count
  elif i == "S":
    count = 0

print(max)
s = input()

if "RRR" in s:
    print("3")
elif "RR" in s:
    print("2")
elif "R" in s:
    print("1")
else:
    print("0")
S = str(input())
ans = 0
now = 0
for i in range(3):
  if S[i] == "R":
    now += 1
    #print(now)
    ans = max(ans,now)
  else:
    now = 0
print(ans)
# -*- 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)
s = input()

if s.count("R") == 0:
    print(0)
elif s.count("R") == 1:
    print(1)
elif s.count("R") == 3:
    print(3)
else:
    if s == "RRS" or s == "SRR":
        print(2)
    else:
        print(1)
# 2020/08/15
# AtCoder Beginner Contest 175 - A

# Input
s = input()

# Calc
cnt = 0
for i in range(len(s)):
    if s[i] == 'R':
        cnt = cnt + 1

if cnt == 3:
    ans = 3
elif cnt == 2:
    if s[1] == 'S':
        ans = 1
    else:
        ans = 2
elif cnt == 1:
    ans = 1
else:
    ans = 0

# Output
print(ans)
s = input()

if s.count('RRR'):
    print(3)
elif s.count('RR'):
    print(2)
elif s.count('R'):
    print(1)
else:
    print(0)
a=input()
b=a.split('S')
ans=0
for i in b:
    if len(i)>ans:
        ans=len(i)
print(ans)
S = input()
if S == 'RRR':
  print(3)
elif 'RR' in S:
  print(2)
elif 'R' in S:
  print(1)
else:
  print(0)
s=input()
l=[['SSS'],['RSS','SRS','SSR','RSR'],['RRS','SRR'],['RRR']]
for i in range(4):
  if s in l[i]:
    print(i)
    exit()
s = input()
if s == "RRR":
    print(3)
    exit()
    
elif s == "RRS" or s == "SRR":
    print(2)
    exit()
    
elif s == "SSS":
    print(0)
    exit()
    
else:
    print(1)
def main():
    ss = list(input())
    r_count = ss.count("R")
    if r_count == 2 and ss[0] == "R" and ss[2] == "R":
        ans = 1
    else:
        ans = r_count
    print(ans)


if __name__ == "__main__":
    main()
s=input()
if s.count("R") == 2:
  if s[1] == "R":
    print(2)
  else:
    print(1)
else:
  print(s.count("R"))
c = 0; ans = 0
x = input()
if x =='RRR': print(3)
elif x in ['SRR', 'RRS']: print(2)
elif x=='SSS': print(0)
else:print(1)
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()
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

s = S.count('R')
if s==2 and S[0] == 'R' and S[2] == 'R':
    s -= 1

print(s)
s=input()
if s.count('RRR')==1:
  print(3)
elif s.count('RR')==1:
  print(2)
elif s.count('R')!=0:
  print(1)
else:
  print(0)
s = input()
count = 0
m = 0
for c in s:
    if(c == "R"):
        count+=1
if count != 2:
    print(count)
elif s[1] == "S":
    print(1)
else:
    print(2)
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)
S = input()

if "R" not in S:
  print(0)
elif "RRR" in S:
  print(3)
elif "RR" in S:
  print(2)
elif "R" in S:
  print(1)
S = input()
ans = 0
for i in range(len(S)):
    if S[i]=='R':
        ans+=1
if ans==2:
    if S[0]!=S[1] and S[1]!=S[2]:
        ans-=1
print(ans)
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)
# A - Rainy Season

S = str(input())

if S == 'RRR':
    print(3)
elif S == 'SRR' or S == 'RRS':
    print(2)
elif S == 'SSR' or S == 'SRS' or S == 'RSS' or S == 'RSR':
    print(1)
else:
    print(0)
s = input()
c1 = s.count('R')
if c1 == 3:
  print(3)
elif c1 == 2:
  if s[1] == 'S':
    print(1)
  else:
    print(2)
elif c1 == 1:
  print(1)
else:
  print(0)
w = input()

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

else:
    print(w.count("R"))
S = str(input())

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

if S == "RRR":
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)
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)
s1, s2, s3 = str(input())
if s1 == "R":
  if s2 == "S":
    result = 1
  else:
    if s3 == "S":
      result = 2
    else:
      result = 3
else:
  if s2 == "S":
    if s3 == "S":
      result = 0
    else:
      result = 1
  else:
    if s3 == "S":
      result = 1
    else:
      result = 2

print(result)
s=input()
ans=0
m=0
for i in range(3):
    if s[i]=="R":
        m+=1
    else:
        ans=max(m,ans)
        m=0
ans=max(m,ans)
print(ans)
s  = str(input())
if s.count('RRR'):
    print(3)
    exit()
if s.count('RR'):
    print(2)
    exit()
if s.count('R'):
    print(1)
    exit()
print(0)
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)
s = input()

if s == "RRR":
  print(3)
elif s == "SRR" or s == "RRS":
  print(2)
elif s == "SSS":
  print(0)
else:
  print(1)
s=input()
if(s=="RRR"):
  print(3)
elif((s=="RRS")or(s=="SRR")):
  print(2)
elif(s=="SSS"):
  print(0)
else:
  print(1)
s=input()
if s=="RRR":
    print("3")
elif s=="RRS" or s=="SRR":
    print("2")
elif s=="SSS":
    print("0")
else:
    print("1")
s=input()
if s == "RSR":
    print(1)
else:
    print(s.count("R"))
s=input()
cnt=0
ans=0
for i in range(3):
    if s[i]=='R':
        cnt+=1
    else:
        ans=max(cnt,ans)
        cnt=0
print(max(ans,cnt))
S = input()
if S == "RRR":
    print(3)
elif S[0:2] == "RR" or S[1:3] == "RR":
    print(2)
elif S[0] == "R" or S[1] == "R" or S[2] == "R":
    print(1)
else:
    print(0)
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]=="S" and s[1] == "S" and s[2] == "S":
  print(0)
else:
  print(1)
import re
s = input()
arr = re.split(r'S+', s)
print(max([len(e) for e in arr]))
s = input()
res = 0
prev = ''
for c in s:
  if c == 'R':
    if prev == 'R':
      res += 1
    else:
      res = 1
  prev = c
print(res)
S = input()
count = 0
result = 0
for i in range(3):
  if S[i] == 'R':
    count += 1
    if result < count:
      result = count
  else:
    count = 0
print(result)
#A問題

S = input()
if S == "RRR":
    print(3)
if S == "RRS"or S == "SRR" :
    print(2)
if S == "SSS":
    print(0)
else:
    print(1)
#coding:utf-8

a = input()

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

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

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

else :
    print("1")
S = input()

cnt = 1
for i in range(len(S)-1):
    if S[i] == S[i+1] and S[i] == "R":
        cnt += 2
    elif S[i] != S[i+1] and S[i+1] == "R":
        cnt += 1
    else:
        cnt = 0
print(cnt)
s = str(input())

if s[1]== "R" and s[2]=="R" and s[0]== "R":
  print(3)
elif s[1] == "S" and s[2] == "S" and s[0] == "S":
  print(0)
elif s[1] == "S" and s[0]=="R":
  print(1)
elif s[1] =="S" and s[2]=="R":
  print(1)
elif s[1] == "S" and s[0]=="R":
  print(1)
elif s[1] =="R":
  if s[0] =="R" or s[2]=="R":
    print(2)
from math import *
import sys,bisect,copyreg,copy,statistics,os
def inp(): return sys.stdin.readline().strip()
def IIX(): return (int(x) for x in sys.stdin.readline().split())
def II(): return (int(inp()))
def LI(): return list(map(int, inp().split()))
def LS(): return list(map(str, inp().split()))
def L(x):return list(x)
def out(var): return sys.stdout.write(str(var))

s=L(inp())
con=0

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

out(con)
s=input()
ans=0
i=0
while i<3 and s[i]=='R':
    i+=1
    ans+=1
print(ans)
S = list(input())

cnt = 0

if S[0]=="R":
    cnt = 1

if S[1]=="R":
    cnt += 1
    if S[2]=="R":
        cnt += 1
else:
    if S[2]=="R":
        cnt += 1
    
    
print (cnt)
s = input()
ans,cnt = 0,0
for l in s:
  if l=='R':
    cnt += 1
  else:
    ans = cnt
    cnt = 0
print(ans)
list = input()
#print(list[2])
#print(len(list))
cnt = 0
for n in list:
  #print(n)
  if n == "R":
    cnt+=1
print(cnt)
S=str(input())

ans = 0
for i in S:
	if i == "R":
		ans += 1
print(ans)
S = input()
if S=="RRR":
    print(3)
elif S=="RRS":
    print(3)
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)
st = input()
if st[0] == st[1] and st[0] == st[2] and st[0] == "R":
  print(3)
elif (st[0] == st[1] and st[0] == "R") or (st[1] == st[2] and st[1] == "R"):
  print(2)
else:
  print(1)
S  = input()
m = 0
c = 0
for s in S:
  if s == 'R':
    c += 1
  else:
    c == 0
  m = max(m, c)
print(m)
S = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0
print(ans)
a,b,c = map(str,input().rstrip(""))


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

print(count)
day = input()
count = day.count("R")
count1 = day.count("RR")
if count == 2:
    if count1 == 1:
	    print(2)
    else:
    	print(1)
if count == 1:
    print(1)
if count == 0:
    print(0)
s=input()
flg = 0
cnt = 0
if s[1] == "S":
    flg = 1
for i in range(3):
    if s[i] == "S":
        cnt += 1
print(cnt if flg == 1 else cnt -1)
S = 'RRS'
p = 0
for i in range(len(S)):
    if S[i] != 'S':
        p =+ 1
    else:
      	p == 0
print(p)
import re

x = input()
pattern = "R+"
pat = re.match(pattern, x)
if pat:
  print(len(pat.group()))
else:
  print(0)
S = input()
r = 0
s = 0
ans = 0
for i in range(3):
    if S[i] == 'R':
        r = r + 1
    else:
        if r > ans:
            ans = r
print (ans)
s = input()
count, final = 0, 0
for i in s:
    if i == "R": count += 1
    elif i == "S":
        if count > final: final, count = count, 0
print(final)
i = 0
j = 0

w = ""
for s in input():
    j += 1

    if s == "R" and (w == s or w == ""):
        i += 1
    elif s == "R" and w != s:
        i += 1
    
    if s == "S" and i > 0 and j == 2:
        i -= 1

    w = s

print(i)
S = input()
ans = 0
count = 0

for i in S:
    if i == "R":
        count += 1

if count >= 3:
    ans = 3

elif count >= 1 :
    if S[1] == "S":
        ans = 1
    else:
        ans = 2
else:
    ans = 0

print(ans)
s = input()
a = 0
for i in range(3):
    if s[i] == 'R':
        a += 1
    else:
        a = 0
print(a)
S = input()[0:3]
res = 0
if S == 'RRS' or S == 'rrs':
    res = 2
elif S=='RRR' or S == 'rrr':
    res = 3
elif S=='RSR' or S == 'rsr':
    res =1
elif S=='RSS' or S=='rss':
    res = 1
else:
    res = 0
print(res)
s = input()
counter = 0
buffer = 0
if not 'R' in s:
    print(0)
else:
    for i in range(len(s)):
        if s[i] == 'R':
            buffer += 1
        else:
            counter = buffer
            buffer = 0
        if buffer > counter:
            counter = buffer
    print(counter)
s = input()
if s == 'RRR':
    print(3)
elif s == 'RRS' or 'SRR':
    print(2)
elif s == 'SSS':
    print(0)
else:
    print(1)
s = input()
s = s.replace('S', '')
print(len(s))
a = input()
m = 0
i = 0
s = 0
while i < len(a) :
    if a[i] == "S" :
        if m < s :
            m = s
        s = 0
    if a[i] == "R" :
        s = s + 1
    i = i + 1
print(m)
S = str(input())
count = 0
for x in range(len(S)):
    if S[0] == 'R' and x == 0:
        count = count + 1
    elif S[x] == 'R' and S[x - 1] == 'R':
        count = count + 1
    elif S[x] == 'S':
        continue

if count >= 0:
    print(count)
else:
    print(0)
s=input()
cnt=0
if s=='RRR':
  cnt = 3
elif s== 'RRS':
  cnt = 2
elif s== 'SRR':
  cnt = 2
elif s == 'RSS':
  cnt= 1
elif s == 'RSR':
  cnt=1
elif s=='SSR':
  cnt=1
print(cnt)
S = input()

count_r = 0
count_s = 0
tmp = 0
for i,s in enumerate(S):
  if(s == "R"):
    count_r +=1
  if(s=="S"):
    count_s += 1
    tmp = count_r
    
print(tmp)
weathers = list(input())
rainy = 0
seq_rainy = 0

for i in range(len(weathers)):
      #print(weathers[i],rainy,seq_rainy)
      if weathers[i] == "R":
            rainy += 1
      else:
            if rainy >= seq_rainy:
                  seq_rainy = rainy
            rainy = 0

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

count=0
for i in range(3):
    if s[i] == "R":
        count+=1
        max=count
    else:
        max=count
        count=0
print(max)
S = input()
if S == "RRR":
  print(0)
elif S == "SSS":
  print(3)
elif S == "SSR" or S == "RSS":
  print(2)
else:
  print(1)
RS = input()
answer = 0

for i, j in enumerate(RS):
  if j == "R":
    answer += 1
  elif (i == 2 and j == "S") or (i == 1 and j == "S"):
    continue
  else:
    answer = 0
print(answer)
s = input()
ans = 0

for i in range(1,4):
  p = "R"*i
  if p in s:
    ans = i
print(i+1)
S = input()
if S == "RRR":
    print(3)
elif S == "SSS":
    print(0)
elif S == "RSR":
    print(1)
else:
    print(2)
N=input()
if N=="RRR":
  print(3)
elif N=="SRR" or N=="RSR" or N=="RRS":
  print(2)
elif N=="SSR" or N=="SRS" or N=="RSS":
  print(1)
else:
  print(0)
S=input()
if (S=="RRS" or S=="SRR"):
    print (2)
elif S=="RRR":
    print (3)
else:
    print (0)