peterverebics/CodeNet_Python_118 huggingface dataset:
s=input()
t=s.find('R')
if t==2:
    print(1)
elif t==-1:
    print('0')
elif t==0:
    if s[t]==s[t+1]:
        if s[t+1]==s[t+2]:
            print('3')
        else:
            print('2')
    else:
        print(1)
else:
    if s[t]==s[t+1]:
        print(2)
    else:
        print(1)
n = input()
if n[0] == "S":
    if n[1] == "S":
        if n[2] == "S":
            print("0")
        else:
            print("1")
    else:
        if n[2] == "S":
            print("1")
        else:
            print("2")
else:
    if n[1] == "S":
        print("1")
    else:
        if n[2] == "S":
            print("2")
        else:
            print("3")
S = input()
s_num = len(S)

i=0
max_count = 0
count = 0

while i < s_num:
    if S[i] != "R":
        if max_count < count:
            max_count = count
            count = 0
    elif S[i] == "R":
        count += 1

    i+=1

if max_count < count:
    max_count = count

print(max_count)
weatherS = input()
p = weatherS[0] == 'R'
q = weatherS[1] == 'R'
r = weatherS[2] == 'R'

if p and q and r:
    serial = 3
elif (p and q) or (q and r):
    serial = 2
elif p or q or r:
    serial = 1
else:
    serial = 0

print(serial)
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)
s = input()
for i in range(5):
    if "R"*i not in s:
        print(i-1)
        break
s = input()
ans1 = 0
ans = 0
for i in range(3):
    if s[i]=="R":
        ans1 += 1
    else:
        ans = ans1
        ans1 = 0
if not s=="RSS":
    print(max(ans,ans1))
else:
    print("1")
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)
s = input()

if s.count("R") in [0,1,3]:
  print( s.count("R") )
else:
  if s == "RSR":
    print(1)
  else:
    print(2)
S = input()

if 'RRR' == S:
    print(3)
elif 'RR' in S:
    print(2)
elif 'R' in S:
    print(1)
else:
    print(0)
from sys import stdin
input = stdin.readline

s = input()
a = b = c = 0
a = (s[0] == 'R') * 1
b = (s[1] == 'R') * (1 + a)
c = (s[2] == 'R') * (1 + b)
print(max(a, b, c))
a = input('')
S = []
num = 0
for i in a:
    S.append(i)
for j in range(3):
    if S[j] == 'R':
        num += 1
if num == 2 and S[1] == 'S':
    print(1)
else:
    print(num)
S = input()

cnt = 0

if S.count('R') == 0:
    cnt = 0
elif S.count('R') == 1:
    cnt = 1
elif S.count('R') == 3:
    cnt = 3
else :
    if S[1] == 'R':
        cnt = 2
    else :
        cnt = 1
        
print(cnt)
s = input()
cnt = 0
maxcnt = 0
for c in s:
    if c == 'R':
        cnt += 1
    else:
        cnt = 0
    if maxcnt < cnt:
        maxcnt = cnt
print(maxcnt)
def main():
    s = input()
    cnt = 0
    cnt2 = 0
    for i in s:
        if i == "R":
            cnt2 += 1
        else:
            cnt = max(cnt, cnt2)
            cnt2 = 0
    print(max(cnt, cnt2))


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

cnt = 0
if 'RRR' in s:
    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' or s == 'SRR':
    print(2)
elif s == 'SSS':
    print(0)
else:
    print(1)
#!/usr/bin/env python
# coding: utf-8

def ri():
    return int(input())

def rl():
    return list(input().split())

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

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


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

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

print(ans)
import re

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

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

ans.append(a)
print(max(ans))
S=input()
if S=="RSR":
  print(1)
else:
  print(S.count("R"))
s = input()
if s.count('RRR') == 1:
    print(3)
elif s.count('RR') == 1:
    print(2)
elif s.count('R'):
    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)
LL = input()


count = 0
maxcount = 0

for ll in LL:
    if ll == "R":
        count+= 1
    else:
        count = 0
    
    if maxcount <= count:
        maxcount = count

print(maxcount)
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)
# a,b = map(int, input().split())
s = input()
c = s.count("R")

if c == 1:
    print(c)
elif c == 2:
    if s[0] == s[1]:
        print(c)
    elif s[1] == s[2]:
        print(c)
    else:
        print(1)
elif c == 3:
    print(3)
elif c == 0:
    print(0)
w=list(input())
n=len(w)
S=0
S_max=S
for i in range(n):
  if w[i]=='R':
    S+=1
    j=0
    while True:
      if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
  S_max=max([S_max,S])
  S=0
print(S_max)
s=str(input())
if s=="RRR":
  print(3)
elif s=="RRS" or s=="SRR":
  print(2)
elif s=="SSS":
  print(0)
else:
  print(1)
d = input()

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

if s == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
elif s == "SSS":
    print(0)
else:
    print(1)
#!/usr/bin/env python3
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()
ans = 0
if "R" in s:
  ans = 1
if s[0] == s[1] == "R":
  ans += 1
if s[1] == s[2] == "R":
  ans += 1
print(ans)
s = input()
w = ["R","RR","RRR"]
ans = 0

for i in range(3):
    if w[i] in s:
        ans = i + 1
        
print(ans)
s = input()

if ("RRS" == s) or ("SRR" == s) :
    print(2)
elif ("RSS" == s) or ("SRS" == s) or ("SSR" == s) or ("RSR" == s):
    print(1)
elif ("SSS" == s):
    print(0)
elif ("RRR" == s):
    print(3)
import sys
import numpy as np
X = str(input())

d = 0
s = 0
for i in X:
    if i == 'R':
        d += 1
    else:
        if s < d:
            s = d
        d = 0
if s < d:
    s = d

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

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

if "R" not in s:
    print(0)
    exit()
ans = 1
for i in range(2):
    if s[i] == "R" and s[i+1] == "R":
        ans += 1

print(ans)
S = str(input())
a=0
if 'R'in S:
    a=1
    if 'RR'in S:
        a=2
        if 'RRR'in S:
            a=3
print(a)
s=input()
c=0
m=0
flg=False
for x in s:
    if x=="R" and flg:c+=1;m=max(m,c)
    if x=="R" and not flg:
        flg=True
        c=1
        m=max(m,c)
    if x=="S":
        flg=False
        c=0
print(m)
s = input()
ans = 0
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)
s=input()
if s=='RRR':
    print(3)
elif s=='SRR':
    print(2)
elif s=='RRS':    
    print(2)
elif s=='SSS':
    print(0)
else:
    print(1)
ans = 0
tmp = 0
for s in input():
    if s == 'R':
        tmp += 1
    else:
        ans = max(ans,tmp)
        tmp = 0
print(max(ans,tmp))
S=input()
ans=0
kouho=0
for i in range(len(S)):
  if S[i]=="R":
    kouho+=1
    ans=max(ans,kouho)
  else:
    kouho=0
print(ans)
s = input()

if s[1] == "R":
  print(s.count("R"))
else:
  if "R" in s:
    print(1)
  else:
    print(0)
st = input()
tmp=0
rt = 0
for i in range(len(st)):
  if st[i] == "R":
    tmp+=1
    if tmp > rt:
      rt = tmp
  else:
    tmp = 0
print(rt)
S = input().rstrip()
if S == "RRR":
    print(3)
elif S=="SRR" or S=="RRS":
    print(2)
elif S == "RSS" or S=="SRS" or S=="SSR" or S=="RSR":
    print(1)
else:
    print(0)
S = input()
count = 0
ans = 0
for i in range(3):
  if S[i] == "R":
    count += 1
    ans = max(ans, count)
  else:
    ans = max(ans, count)
    count = 0


print(ans)
s = input()

ans=0

if s.count("R")>0: ans = 1

if s[:2]=="RR": ans = 2
if s[1:]=="RR": ans = 2

if s == "RRR": ans = 3

print(ans)
s = input()
record = list(s)
n = 0
high_score = 0
yesterday = ' '
for today in record :
    ####### main
    if today == 'R':
        if yesterday == 'R' :
            n += 1
        else :
            n = 1
    ###### ato
    if high_score < n :
        high_score = n
    yesterday = today
print(high_score)
S = list(input())
count = 0
ans = 0

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

    
print(ans)
s = input()

if (s == "RRR"):
    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)
s = input()

ans = 0
t = 0
for c in s:
    if c == "R":
        t += 1
    else:
        ans = max(ans, t)
        t = 0
ans = max(ans, t)


print(ans)
S =input()

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

print(cntmax)
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)
S=input()

if S[0]==S[1]==S[2]:
  if S[0]=='R':
    print(3)
  else:
    print(0)
elif S[0]==S[1]:
  if S[0]=='R':
    print(2)
  else:
    print(1)
elif S[1]==S[2]:
  if S[1]=='R':
    print(2)
  else:
    print(1)
else:
  print(1)
S = input()
if S == 'RRR':
    print(3)
elif S == 'SSS':
    print(0)
elif S == 'SRR' or S == 'RRS':
    print(2)
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')
import re
s=input()

rs = [len(x) for x in re.findall("R{1,}", s)]

if rs == []:
    print(0)
else:
    print(max(rs))
s = input()
if 'RRR' in s:
    print(3)
elif 'RR' in s:
    print(2)
elif 'R' in s:
    print(1)
else:
    print(0)
n = input().split('S')
print(len(sorted(n,key=len, reverse=True)[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 == "RSS":
    print(1)
elif S == "SSR":
    print(1)
else:
    print(0)
S = input()
prev = True
ans = 0
cnt = 0
for i in range(3):
  if S[i] == 'R':
    if prev:
      cnt += 1
    else:
      prev = True
      cnt = 1
  else:
    ans = max(ans, cnt)
    cnt = 0
    prev = False
print(max(ans, cnt))
s = input()

if s == 'RSR':
    print(1)
    exit()

ans = 0

for i in s:
    if i == 'R':
        ans += 1

print(ans)
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)
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 "R" in s:
    if "RR" in s:
        if "RRR" in s:
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    print(0)
A = input()

if 'RRR' in A:
    print(3)
elif 'RR' in A:
    print(2)
elif 'R' in A:
    print(1)
else:
    print(0)
s = input()
ans = 0
if s[0] == "R":
    ans += 1
    if s[1] == "R":
        ans += 1
        if s[2] == "R":
            ans += 1
elif s[1] == "R":
    ans += 1
    if s[2] == "R":
        ans += 1
elif s[2] == "R":
    ans += 1
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)
s = input()
if s == "RRR" :
    print(3)
elif s =="RRS" or s =="SRR" :
    print(2)
elif "R" in s:
    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] == 'R' or S[1] == 'R' or S[2] == 'R':
    print(1)
else:
    print(0)
# input 長さ3の文字列
input_s = input();

output = 0;

if "R" in input_s:
    output = 1;

if "RR" in input_s:
    output = 2;

if "RRR" in input_s:
    output = 3;

print(output);
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()
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)
X = input()
if X =='RRR':
    print('3')
elif X =='RRS' or X =='SRR':
    print('2')
elif X =='RSS' or X =='SRS' or X =='SSR' or X =='RSR':
    print('1')
elif X =='SSS':
    print('0')
s = input()

if s.count('S') == 0:
    print(3)
elif s[:2] == 'RR' or s[1:3] == 'RR':
    print(2)
elif s[0] == 'R' and s[2] == 'R':
    print(1)
elif s.count('R') == 1:
    print(1)
else:
    print(0)
S = input()
s = list(S)
a = 0
for i in s:
    if i == 'R':
        a += 1

if a != 2:
    print(a)
elif s[1] == 'R':
    print(2)
else:
    print(1)
t = input()
ans = 0
maxans = 0
for i in t:
  if i =="R":
    ans += 1
  else:
    maxans = max(ans,maxans)
    ans = 0
print(max(maxans,ans))
s = input()

ans = 0
if s.count("R") == 3:
    print(3)
elif s.count("R") == 2:
    if s[0] == s[1] or s[1] == s[2]:
        print(2)
    else:
        print(1)
elif s.count("R") == 1:
    print(1)
else:
    print(0)
s = input()
if s == 'RRS' or s == 'SRR':
    print(2)
elif s == 'RRR':
    print(3)
elif s == 'SSS':
    print(0)
else:
    print(1)
S = list(input())

r_cnt = 0
max_r_cnt = 0

for s in S:
    if s == "R":
        r_cnt += 1

    else:
        r_cnt = 0
    max_r_cnt = max(r_cnt, max_r_cnt)

print(max_r_cnt)
import sys
def S(): return sys.stdin.readline().rstrip()

S = S()
if S == 'RRR':
    print(3)
elif S == 'RRS' or S == 'SRR':
    print(2)
elif S == 'SSS':
    print(0)
else:
    print(1)
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)
s=input()
count=0
count1=0
for i in s:
    if i=='R':
        count+=1
        if count1<count:
            count1=count
    else:
        count=0
print(count1)
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()

if 'RRR' in s:
   result = 3
elif 'RR' in s:
   result = 2
elif 'R' in s:
   result = 1
else:
   result = 0

print(result)
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)
def resolve():
    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)
resolve()
S = input()
s = list(S)
if S == "RSR":
    print(1)
else:
    print(s.count('R'))
def find(s):
  ans=0
  for i in s:
    if i=="R":
      ans+=1
    elif i=="S" and ans>0:
      return ans
  return ans
s=input()
print(find(s))
s = input()
ans,cnt = 0,0
for l in s:
  if l=='R':
    cnt += 1
    ans = max(ans,cnt)
  else:
    ans = max(cnt,ans)
    cnt = 0
print(ans)
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)
x=input()
if "RRR" in x:
    print(3)
elif "RR" in x:
    print(2)
elif "R" in x:
    print(1)
else :
    print(0)
s=input()
if s.count('R')<2 or s.count('R')==3:
  print(s.count('R'))
  exit()
if 'RR' in s:
  print(2)
else:
  print(1)
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)
S = str(input())

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

if S=="SSS":
    print(0)
elif 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)
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)
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.readline

def main():
    S = input()[:-1]
    if S == 'RRR':
        print(3)
    elif S in ['RRS', 'SRR']:
        print(2)
    elif S == 'SSS':
        print(0)
    else:
        print(1)

if __name__ == "__main__":
    main()
def main():
    s = input()
    counts = [0]

    for c in s:
        if c == 'S':
            counts.append(0)
        if c == 'R':
            counts[-1] += 1

    print(max(counts))


if __name__ == '__main__':
    main()
s=input()
n=len(s)
ans=0
t=0
for i in range(n):
    if s[i]=="R":
        t+=1
        if t>ans:
            ans=t
    else:
        t=0
print(ans)
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()))
w = input()
if 'RRR' in w:
    print(3)
elif 'RR' in w:
    print(2)
elif 'R' in w:
    print(1)
else:
    print(0)
S=str(input())
if S == "RRR":
    print(3)
elif S == "SRR":
    print(2)
elif S == "RRS":
    print(2)
elif S == "SSS":
    print(0)
else:
    print(1)
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()
r = 0
l = 'R'
for i in s:
    r = 1 if i == 'R' and l == 'S' else r
    r += 1 if i == 'R' and l == 'R' else 0
    l = i

print(r)
S = input()


count = S.count('R')

if count == 0 or count == 1 or count == 3:
    print(count)
else:
    if S == 'RRS' or S == 'SRR':
        print(count)
    elif S == 'RSR':
        print(1)
S = input()

Rs = S.split("S")

count = 0
for r in Rs:
  if len(r) > count:
    count = len(r)
    
print(count)
a = input()
if a.count('RRR') > 0:
    print(3)
elif a.count('RR') > 0:
    print(2)
elif a.count('R') > 0:
    print(1)
else:
    print(0)
#A
import sys
s = input()

num = s.count("R")

if num >= 2:
    if s[1] == "S":
        num = 1

print(num)
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)
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)
s = input()
ans = 0
if 'R' not in s:
  ans = 0
else:
  if s == 'RRR':
    ans = 3
  elif s == 'SRR' or s == 'RRS':
    ans = 2
  else:
    ans = 1
print(ans)
# -*- coding: utf-8 -*-
S = input()
ans = 0
for i in range(len(S)):
  if S[i] == "R":
    if ans == 0:
      ans += 1
    else:
      if i > 0 and S[i] == S[i-1] == "R":
        ans += 1
print(ans)
Word = input()

counter=0
maxc = 0

for i in range(len(Word)):
    if 'R'==Word[i]:
        counter +=1
        maxc = max(counter, maxc)
    else:
        counter=0
print(maxc)
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)
S = list(input())

rain_max = 0
rain_cnt = 0
flag = False
for i in range(len(S)):
    if S[i] == 'R':
        rain_cnt += 1
    else:
        if rain_cnt > rain_max:
            rain_max = rain_cnt
            flag = True
        rain_cnt = 0

if not flag:
    rain_max = rain_cnt

print(rain_max)
S = input()

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

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)
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()

ans = 0

if S == "RRR":
    ans = 3
elif S == "RRS":
    ans = 2
elif S == "RSR":
    ans = 1
elif S == "RSS":
    ans = 1
elif S == "SRR":
    ans = 2
elif S == "SRS":
    ans = 1
elif S == "SSR":
    ans = 1
elif S == "SSS":
    ans = 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)
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')
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.count("R"):
    if s.count("RR"):
        if s.count("RRR"):
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    print(0)
s=input()
if s=="SSS":
    print(0)
elif s=="SSR" or s=="RSS" or s=="SRS" or s=="RSR":
    print(1)
elif s=="SRR" or s=="RRS":
    print(2)
else:
    print(3)
S = input()
cnt = 0
if S == 'RRR':
    cnt = 3
elif S == 'RRS' or S == 'SRR':
    cnt = 2
elif 'R' in S:
    cnt = 1
else:
    cnt = 0
# for i in range(len(S)):
#     if(S[i] == 'R'):
#         cnt += 1
#     else:
#         cnt = 0
print(cnt)
N =input()
if N == 'RRR':
  print('3')
elif 'RR' in N:
  print('2')
elif 'R' in N:
  print('1')
else:
  print('0')
s = input()
if s.count('R') == 3:
	print(3)
elif s.count('R') ==2:
	if s.count('RR') != 0:
		print(2)
	else:
		print(1)
elif s.count('R') ==1:
	print(1)
else:
	print(0)
s = input()
ans = 0
for i in range(1, 4):
  if 'R'*i in s:
    ans = len('R'*i)
print(ans)
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)
s = input()

def ans(a):
    if s == 'RSR':
        return 1
    else:
        return (s[0] == 'R') + (s[1] == 'R') + (s[2] == 'R')

print(ans(s))
s = input()

if s=='RRR':print(3)
if s=='SSS':print(0)

if s=='RRS':print(2)
if s=='SSR':print(1)

if s=='RSR':print(1)
if s=='SRS':print(1)

if s=='SRR':print(2)
if s=='RSS':print(1)
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()

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))
N=input()
if N=='RRR':
  print(3)
elif N=='RRS' or N=='SRR':
  print(2)
elif N=='SSS':
  print(0)
else:
  print(1)
def solve():
    n = input()
    if n == "RRR":
        print(3)
    elif "RR" in n:
        print(2)
    elif "R" in n:
        print(1)
    else:
        print(0)

solve()
S = str(input())

if S.find('RRR')!=-1:
  print(3)
elif S.find('RR')!=-1:
  print(2)
elif S.find('R')!=-1:
  print(1)
else:
  print(0)
n = input()
ans = 0
temp = 0
for i in range(len(n)):
    if n[i] == "R":
        temp += 1
        ans = max(temp,ans)
    else:
        temp = 0

print(ans)