peterverebics/CodeNet_Python_118 huggingface dataset:
from sys import exit
X = list(input())
X.append("")
N = len(X)
#X = [[0] for i in range(N+1)]
ans = 0
i = 0
while i < N:
#for i in range(N-1):
    if X[i]=="R":
        ans += 1
        if X[i]==X[i+1]:
            ans += 1
            i += 1
    i += 1
print(ans)
S = input()
if S == "SSS":
    print("0")
elif S == "SSR"or"SRS"or"RSS"or"RSR":
    print("1")
elif S == "SRR"or"RRS":
    print("2")
elif S == "RRR":
    print("3")
S = input()
p = 0
for i in range(len(S)):
    if S[i] != 'S':
        p =+ 1
print(p)
S = input()
if S == 'SSS':
  print(0)
elif S == 'SRR':
  print(2)
elif S == 'RRS':
  print(2)
elif S == 'RRR':
  print(3)
s=str(input(""))
sum=0
if 'RR' in s:
    print("2")
elif 'R' in s:
    print("1")
else:
    print("0")
str = input()
splited = list(str)

cccount = 0
count = 0
for s in splited:
  if s == 'R':
    count = count + 1
  else:
    if cccount > count:
      cccount = count
    count = 0
print(cccount)
S = input()

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

cnt = 0
max_cnt=0

if S[0] == 'R':
    cnt += 1

for i in range(1,3):
    if S[i] == 'R':
        cnt+=1
    else:
        if cnt > max_cnt:
            max_cnt = cnt
        cnt = 0
        
if S[len(S)-1] == 'R' and max_cnt == 0:
    max_cnt = 1
print(max_cnt)
s = input()
temp = 0
ans = 0
for i in s:
    if(i == "R"):
        temp += 1
    else:
        if(temp >= ans):
            ans = temp
            temp = 0
if(temp >= ans):
    ans = temp
print(temp)
a=input()

if a == "RRR":
  answer=2
elif a=="RRS" or a=="SRR":
  answer=1
else:
  answer=0
  
print(answer)
ws = input()

rev = 0
for ch in ws:
    if ch == 'R':
        rev += 1
    else:
        rev = 0

print(rev)
s = input()


result = 0
flag = False
for rs in s:

    if flag:
        if rs == 'R':
            tmp += 1
        else:
            if tmp > result:
                result = tmp
            flag = False
            
    else:
        if rs == 'R':
            tmp = 1
            flag = True
        
        
print(result)
d = input()
c = 0

for i in range(3):
  if d[i] == 'R':
    c += 1
    
if c == 2 and d[1] == 'R':
  print(0)
else:
  print(c)
str = input()
def an(str):
  if str =="RRR":
    return 3
  elif str =="SRR" or "RRS":
    return 2
  elif str =="SSS" :
    return 0
  else:
    return 1
print(an(input))
x=list(input())
if x.count("R")==0:
  print(0)
elif x.count("R")==1:
  print(1)
elif x.count("R")==3:
  print(3)
else:
  if x.pop(2)=="S":
    print(1)
  else:
    print(2)
S = input()
counter = 0
tmp = 0
for s in S:
    tmp += 1
    if s == 'R':
        counter += 1
    elif tmp == 3 and s == 'S':
        break
    else:
        counter = 0
print(counter)
inp = input()
count = 0
if len(inp) == 1:
  if inp=="R":
    print(1)
  elif inp=="S":
    print(0)
else:
  for c in range (1,len(inp)-1):
    if inp[c] == inp[c-1] and inp[c]=="R":
      count+=1
  print(count+1 if count>0 else count)
S = input()
Count = 0
MAXC = 0
for TS in range(0,3):
    if S[TS]=='R':
        Count += 1
    else:
        MAXC = Count
        Count = 0
print(MAXC)
S = input()
count = 0
ans = 0
for i in range(3):
  if S[i] == 'R':
    count += 1
  else:
    ans = count
    count = 0
ans = max(ans, count)
print(ans)
S = input()

R_n = 0
R_max = 0
for i in S:
  if i == 'R':
    R_n += 1
  else:
    R_max = R_n
    R_n = 0
    
if R_n == len(S):
  R_max = R_n

print(R_max)
def main():
    s = input()
    count = 0
    ans = 0

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

    print(ans)
if __name__ == "__main__":
    main()
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)
else:
    print(0)
def count_rainy(weather): 
    return len([r for r in weather if r == 'R'])

weather = input()
print(count_rainy(weather))
a,b,c=map(str,input())
count=0
if a=='R':
  count=count+1
if b=='R':
  count=count+1
if c=='R':
  count=count+1
print(count)
s=input()
cnt=0
for i in s:
	if i=="R":
		cnt+=1
	elif i=="S":
		break
print(cnt)
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' and S=='RSS' or S=='rss':
    res = 1
else:
    res = 0
print(res)
if __name__ == "__main__":
    S = input()
    S = list(S)

    count = 0
    maxc = 0
    for i in S:
        if i == 'R':
            count += 1
            maxc = count
        else:
            maxc = count
            count = 0

    print(maxc)
S=input()
if (S=="RRS" or S=="SRR"):
    print (2)
elif S=="RRR":
    print (3)
elif S=="RSS" or S=="SRS" or S=="SSR":
    print (1)
else:
    print (0)
a, b, c = input()

if b == "R":
  d = 1
  if a == "R":
    d += 1
  if c == "R":
  	d += 1
else:
  d = 0
  if a == "R" or c == "R":
    d += 1
 
print(c)
s =list(input()) 
if s.count('R') == 0  :  
    print(0)  
    
elif s.count('R') == 1 or s == 'RSR':          
    print(1)
    
elif s.count('R') == 3 :          
    print(3)    
    
elif s == 'RRS' or s == 'SRR' :
    print(2)
s = input()
if s == 'RRR':
    print(3)
elif s == 'SRR' or s == 'RRS':
    print(2)
elif s == 'RSS' or s == 'SRS' or s == 'SSR':
    print(1)
else:
    print(0)
s = input()

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

# if s.count("R") == 0:
#     print(0)
# elif s.count("R") == 1 or s == "RSR":
#     print(1)
# elif s.count("R") == 2:
#     print(2)
# elif s.count("R") == 3:
#     print(3)
a=list(input().split())
a="".join(a)
count=0
for i in range(3):
    
    if a[i]=='S':
        count=1
    else:
        count+=1
print(count)
s = str(input())
cnt = 0
Max = 0
for i in s:
    if i == "R":
        cnt += 1
    else:
        Max = max(Max,cnt)
        cnt = 0
print(Max)
s=input()
num=0
a=[0]
for i in s:
    if i=="R":
        num+=1
    elif i!="R":
        a.append(num)
        num=0
print(max(a))
s = raw_input()
count = 0
a = 0
for j in range(len(s)):
	if s[j] == 'R':
		count +=1
	else:
		count = 0
	a = max(count, a)
print
S = input()
ans = 0
while True:
    if 'RR' in S:
        S = S.replace('RR', 'R')
        ans += 1
    else:
        break

if not ans == 0:
    ans += 1

print(ans)
s = input()

if 'R' not in s:
  print(0)
  exit()
  
result = 0
t = 0

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

print(result)
s = input()
if s == 'RRR': print(3)
elif s == 'RRS': print(2)
elif s == 'SRR': print(2)
else: print(1)
S = input()

if S in ['RRR', 'SSS']:
    print(3)
elif S in ['RSS', 'RRS', 'SSR', 'SRR']:
    print(2)
else:
    print(1)
s = input()
l = 0
h = 0
for i in range(0, 3):
  if s[i] == "S":
    h = l
    l = 0
  else:
    l += 1
print(h)
import re
s = input()
print(max(map(len, re.split('R', s))))
s=input()
a=s.count('R')
if a==0:
    print(a)
elif s[1]=='S':
    print(a-1)
else:
    print(a)
def solve():
    s = input()
    ans = 0
    hoge = [0]
    for i in s:
        if i == "R":
            ans += 1
            hoge.append(ans)
        else:
            ans = 0
    print(min(hoge))
    return 0

if __name__ == "__main__":
    solve()
S = input('').split()

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
tmp = 0
for i in range(3):
    if s[i] == 'R':
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
print(ans)
s = str(input()).upper()# S, R == sunny, rainy

def weather(s):
    if s == 'RRR':
        print('3')
    elif s == ('RRS'):
        return 2
    elif s == ('RSR'):
        return 1
    elif s == ('RSS'):
        return 2
    elif s == ('SRR'):
        return 2
    elif s == ('SRS'):
        return 1
    elif s == ('SSR'):
        return 2
    elif s == ('SSS'):
        return 3
    
    

print(weather(s))
a = str(input())
anw = 0

for i in range(0, 3):
    if a[i] == 'RSS' or 'RSR' or 'SSR' or 'SRS':
        anw = 1
    elif a[i] == 'SRR' or 'RRS':
        anw = 2
    elif a[i] == 'RRR':
        anw = 3
    else:
        anw = 0

print(anw)
word = input()
answer = 0
if word[0] == 'R':
    if word[1] == 'R':
        if word[2] == 'R':
            answer = 3
        else:
            answer = 2
    else:
        answer = 1
elif word[1] == 'R':
    if word[2] == 'R':
        answer = 2
    else:
        answer = 1
print(answer)
S = str(input())

cnt = 0

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

print(cnt)
def main():
    s = input()

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

if __name__ == "__main__":
    main()
a = str(input())
anw = 0

for i in range(0, 2):
    if a[i] == 'R':
        anw += 1
    elif i == 2:
        if a[i] == 'S':
            anw = anw
        elif a[i] == 'R':
            anw += 1

print(anw)
S= input()
a = tuple(S)
#print(a)
#print(a[0])

cou = 1
for i in range (0,len(S)-1):
    
    if a[i] == "R":
      if a[i+1] != "S":
          cou+=1
      else:
        break;
          
    
if a[0] == "S":
    cou=0
    #elif a[i]=="S":
     #   cou=0
print(cou)
a
s = input()

if "SSS" in s:
    print(0)
elif "RRR" in s:
    print(0)
elif "SS" in s:
    print(2)
elif "RR" in s:
    print(2)
else:
    print(1)
weather = input()
raincount=0
cont=0
for  i in range(3):
    if weather[i]=="R" and cont==0:
           raincount=raincount+1
    elif weather[i]=="R" and cont==1:
           raincount=1
    elif weather[i] == "S":
        cont=1

print(raincount)
S = input()
cnt = 0
max_cnt = 0
for i in range(len(S)):
  s = S[i]
  if s == 'R':
    cnt += 1
  else:
    max_cnt = cnt
    cnt = 0
print(max_cnt)
s=input()
num=0
for i in s:
    if i=="R":
        num+=1
    elif i!="R":
        num=0
print(num)
s = input()
ans1 = 0
ans = 0
for i in range(3):
    if s[i]=="R":
        ans1 += 1
    else:
        ans = ans1
        ans1 = 0
print(max(ans,ans1))
s = input()

before = ""
count = 0
for i in range(len(s)):
    if s[i] == "R":
        count += 1
        #print(before)
        if before == "n":
            count -= 1
        before = "R"
    else:
        before = "n"
        count += 0
print(count)
s = input()
total = 0

if s == 'RRR':
    total = 3
elif  s == 'RRS' or 'SRR':
    total = 2
elif s == 'RSR' or 'SRS' or 'RSS' or 'SSR':
    total = 1
else:
    total = 0

print(total)
s=list(input())
if s == 'RSR':
  print(1)
  exit()
print(s.count('R'))
S = input()

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

print(result)
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = readline().decode().rstrip()
if S[0] == 'R' and S[2] == 'R':  
    print(S.count('R')-1)
else:
    print(S.count('R'))
s = input() + '@'

lst = [0]*len(s)
for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1
print(max(lst))
S = input()
list_s = list(S)
count = 0
if len(list_s)<4:
    for i in range(3):
        if list_s[i] == 'R':
            count +=1
        elif list_s[i] == 'S':
            count = 0
print(count)
s=input()
ans=0
p=0
for i in s:
    if i=="R":
        p+=1
    else:
        ans=max(ans,p)
        p=0
print(ans)
weather = input()
raincount=0
for  i in range(3):
    if weather[i]=="R":
           raincount=raincount+1
    else:
           raincount=0

print(raincount)
s = input()

if 'RR' in s:
    print(2)
elif 'R' in s:
    print(1)
elif 'RRR' in s:
    print(3)
else:
    print(0)
li = list(map(str, input()))
if len(li)!=3:
  exit()
c=0
for i in range(3):
  if li[i]=='R':
    c=c+1
print(c)
S = str(input())
a = 0
w = 0
for i in range(len(S)):
    if S[i] == 'R':
        w = w + 1
    else:
        if (w > a):
          a = w
        w = 0
print(a)
#coding :utf-8
S=input(">")
if (S=="sss"):
    print(3)
elif(S=="ssr"):
    print(2)
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(0)
s = str(input()).upper()# S, R == sunny, rainy

def weather(s):
    if s == 'RRR':
        return 3
    elif s == ('RRS'):
        return 2
    elif s == ('RSR'):
        return 1
    elif s == ('RSS'):
        return 2
    elif s == ('SRR'):
        return 2
    elif s == ('SRS'):
        return 1
    elif s == ('SSR'):
        return 2
    elif s == ('SSS'):
        return 0
    
    

print(weather(s))
s = input().split('S')

ans = 0

for i in s:
  if len(s) > ans:
    ans = len(s)
    
print(ans)
import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

days = readStringList()
count = 0
res = 0
for c in days:
    count += 0 if c == 'S' else 1
    res = max(res,count)
print(res)
# -*- coding: utf-8 -*-

def main():
    s = str(input())

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

if __name__ == '__main__':
    main()
inp = input()
count=0
res=0
for ch in inp:
  if ch=="R":
    count+=1
  else:
    res=max(res,count)
    count=0
res=max(res,count)
print(count)
a = input()
b = 0
c = 0
for i in a:
    c += 1
    if i == "R" and c == 1:
        b += 1
    elif i == "R" and c == 2 and b == 1:
        b += 1
    elif i == "R" and c == 3 and b == 2:
        b += 1
print(b)
i = 0
j = 0
for s in input():
    j += 1

    if s == "R":
        i += 1
    if j != 3 and i > 0 and s == "S":
        i -= 1

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

count = 0
l = [0]

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

print(max(l))
def resolve():
    S = input()
    count = []
    if S[0] == "R":
        ans = 1
    else:
        ans = 0
    for i in range(len(S)-1):
        if S[i] == "R" and S[i+1] == "R":
            ans += 1
        elif S[i] == "R":
            ans = 1
        else:
            ans = 0
        count.append(ans)
    print(max(count))
resolve()
str = input()
i = 0
if 'R' in str:
        i += 1
        for j in range(len(str)-1):
                if str[j] == str[j+1]:
                        i += 1
print(i)
import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

days = readStringList()
# print(days)
count = 0 if days[0] != 'R' else 1
res = 0
for i in range(1,3):
    if days[i] == 'R' and days[i-1] == 'R':
        count += 1
    elif days[i] == 'R':
        count = 1
    else:
        count = 0
    res = max(res,count)
print(res)
s = input()
ans = 0
if "S" in s:
    ans = 1
if "SS" in s:
    ans = 2
if s == "SSS":
    ans = 3
print(ans)
s = input()

cnt = res = 0
for i in range(3):
    if s[i] == 'R':
        cnt += 1
    else:
        res = max(res, cnt)
        cnt = 0
print(res)
cnt = 0
t = input()
for i in range(len(t)):
    if i == 1:
        if t[i] == "R":
            cnt += 1
    if i != 1:
        if t[i] == "R" and t[i-1] == "R":
            cnt += 1
        if t[i] == "R" and t[i-1] == "S":
            cnt = 1
        else:
            cnt = 0
print(cnt)
s = input()
count = 0
if s[0] == 'R':
  count = 1
for i in range(len(s)-1):
  if s[i] == 'R' and s[i+1] == 'R':
    count += 1
print(count)
c = 0
for i in input().split():
  if i=='R':
    c +=1
print(c)
S=list(input())
n=0
for i in range(3):
    if S[i]=='R':
        n+=1
    elif n==2:
        pass
    else:
        n=0
print(n)
s = str(input())

ans = 0

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

print(ans)
input_data = input()

if input_data == 'RRR':
  count = 3
elif input_data == 'RRB' or input_data == 'BRR':
  count = 2
elif input_data not in 'R':
  count = 0
else:
  count = 1
  
print(count)
s = str(input())
if s == 'SSR' or 'RSS' or 'RRS' or 'SRR' :
  print(2)
elif s == 'SSS' or 'RRR' :
  print(3)
else :
  print(1)
#!/usr/bin/env python3
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

S = input()

ans = 0
for s in S:
    if s == "R":
        ans += 1
        continue
    break
print(ans)
S = input()
result = 0
for i in range(3):
    if S[i] == 'R':
        result = result + 1
    else:
        result = 0

print(result)
s = input()
num = 0
if s[0] == "R":
  num += 1
if s[1] == "R":
  num += 1
if s[2] == "R":
  num += 1
print(num)
N = input()
if N =="SSS":
  print(0)
elif N =="RRR":
  print(3)
elif N =="RRS" or "SRR":
  print(2)
else:
  print(1)
a=list(input().split())
a="".join(a)
count=0
for i in range(3):
    
    if a[i]=='R':
        count+=1
        ans=count
    else:
        count=0
       
        
print(count)
S = input()
if S.count("SSS")>=1:
    print(3)
    exit()
if S.count("SS")>=1:
    print(2)
    exit()
if S.count("S")==0:
    print(0)
    exit()
else:
    print(1)
s=input()
count=0
m=0
for i in range(len(s)):
    if s[i]=='R':
        count+=1
    else:
        if count > m :
            m=count
        count=0

print(m)
s= input()
if s.count('R') ==0:
	print('0')
elif s.count('R') ==1:
	print('1')
elif s.count('RR') ==1:
	print('2')
elif s.count('RSR') ==1:
	print('1')
else:
	print('3')
s = input()

def result(s):
    count = 0
    max = 0
    if s == 'SSS':
        return 0
    for i in s:
        if i == 'R':
            count += 1
        else:
            if max < count:
                max = count
            count = 0
    return max

print(result(s))
S=input()
string1 = 'R'
string2 = 'RR'
if S.count(string1) == 0:
    print('0')
if S.count(string1) == 1 or S == 'RSR':
    print('1')
if S.count(string1) == 2:
    print('2')
if S.count(string1) == 3:
    print('3')
S = input()
if S[1] == "S":
    print(1)
else:
    print(S.count('R'))
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 = 1
print(a)
a=input()
sum=0
for i in a:
  if i=='R':
      sum=sum+1
print (sum)
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[1] == 'R' or S[2] == 'R' or S[1] == 'R':
    print(1)
else:
    print(0)
S = input()

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

cnt = 0
for i in range(3):
    if S[i] == "R":
        cnt += 1
    elif i >= 1:
        break

print(cnt)
S = input()
if S[1] == "R":
    if S[0] == "R" and S[2] == "R":
        print("2")
    elif S[0] or S[2] == "R":
        print("1")
else:
    print("0")
#A - Rainy Season
Si = []
Si = str(input())
i = 0
if Si[0] == 'R': 
    i == 1
if Si[1] == 'R': 
    i == 1
if Si[2] == 'R': 
    i == 1
if Si[0:1] == 'RR': 
    i == 2
if Si[0:1] == 'RR': 
    i == 2
if Si[1:2] == 'RR': 
    i == 2
if Si[0:2] == 'RRR': 
    i == 3

# 出力
print(i)
S = input()
cnt = 0
ma = 0
for i in range(3):
    if S[i]=='R':
        cnt+=1
    else:
        ma=cnt
        cnt=0
if cnt==3:
    print(cnt)
else:
    print(ma)
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[0]=="R" and s[2]=="R":
    print(2)
elif s=="SSS":
    print(0)
else:
    print(1)
def main():
    S = input()

    ans = 0
    tmp = 0
    for s in S:
        if s == 'R':
            tmp += 1
        else:
            ans = tmp
            tmp = 0

    if ans < tmp:
        ans = tmp

    print(ans)


if __name__ == "__main__":
    main()
S=str(input())

if S.count('R')==0:
  print(0)
if S.count('R')==1 and not S.count('R') >1:
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1:
  print(2)
if S.count('RRR')==1:
  print(3)
def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for i in weathers:
        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()))
S = input()

l = len(S)
count = 0

for i in range(l):
    cur_count = 1

    for j in range(i+1,l):
        if S[i] == "S":
            break
        if (S[i] != S[j]):
            break
        cur_count += 1
    if cur_count > count:
        count = cur_count

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

print(s)
r,s=0,input()
for l in s:
  if l=='S':
    break
  r+=1
print(r)
s = input()
max = 0
cnt = 0
for i in range(3):
    if s[i] == "R":
        cnt += 1
    else:
        if max < cnt:
            max = cnt
            cnt = 0
            
print(max)
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)
else:
  print(3)
S = input()

count = 0
for i in range(3):
  if S[i] == 'R':
    count += 1
  elif i == 1:
    break
  elif i == 2:
    break
    
print(count)
s = input().strip().split('S')
print(max(s, key = len))
s=input()

if s == 'SSS':
  print(0)
elif s == 'SSR':
  print(1)
elif s == 'SRS':
  print(1)
elif s == 'SRR':
  print(1)
elif s == 'RSS':
  print(1)
elif s == 'RSR':
  print(1)
elif s == 'RRS':
  print(2)
else:
  print(3)
if __name__ == '__main__':
    S = input()

    cnt = 0
    for s in S:
        if s=='R':
            cnt += 1
    
    print(cnt)
if __name__ == '__main__':
    S = input()
    cnt = 0
    for s in S:
        if s=='R':
            cnt += 1
        else:
            break
    
    print(cnt)
a = str(input())

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

print(count)
S = input()
ans = 0
for s in range(len(S)):
	if S[s]=="R":
		ans +=1

if ans == 3:
    print(3)
elif ans == 1:
    print(1)
else:
    if S[1] == "S":
        print(1)
    else:
        print(2)
s = input()
ans = 0
a = 0
for si in s:
    if si == "R":
        a += 1
    else:
        ans = max(ans,a)
        a = 0
print(ans)
S = input()

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

if count == 3:
    print(3)
else:
    print(max_count)
s = input()
if 'RR' in s:
    print(2)
elif 'RRR' in s:
    print(3)
elif 'R' in s:
    print(1)
else:
    print(0)
n = list(input())
result = 0
for i in range(1, len(n)):
    if n[i] == "R":
        result = 1
        if n[i] == n[i-1]:
            result += 1
    else:
        result = 0
print(result)
s=str(input())
ans=0
if s not in "R":
    ans=0
else:
    if s[1]=="S":
        ans=1
    elif s[0]=="R" and s[2]=="R":
        ans=3
    else:
        ans=2

print(ans)
s=input()
if s.count('R')==1: print(1)
elif s.count('R')==3: print(3)
else:
    if s=="RSR": print(1)
    else: print(2)