peterverebics/CodeNet_Python_118 huggingface dataset:
s = input()
sum_ = 0
if s[0] == 'R':
  sum_ += 1
  if s[1] == 'R':
    sum_ += 1
    if s[2] == 'R':
      sum_ += 1
  else:
    sum_ = 1
else:
  if s[1] == 'R':
    sum_ += 1
    if s[2] == 'R':
      sum_ += 1
print(sum_)
S = input()
if S == "RRR":
    print(3)
elif "RR" in S:
    print(2)
else:
    print(1)
s = input()
ans = 0

if s[0] == "R":
    ans += 1
    if s[1] == "R":
        ans += 1
        if s[2] == "R":
            ans += 1

print(ans)
cnt = 0
t = input()
for i in range(len(t)):
    if "R" * (i + 1) in t:
        print(cnt)
        cnt = i + 1
print(cnt)
S = input()
numR = 0
sunny = False
for i in range(len(S)):
    if S[i] == 'R' and not sunny:
        numR += 1
    else:
        sunny = True
        continue


print(numR)
S=input()

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

if S.count("RR")==1:
    print(2)

else:
    print(S.count("RR"))
s = str(input())
s=s.lower()

if s.find('rr') != -1:
    print("2")
elif s.find('r') !=-1:
    print("1")
else :
    print ("0")
i = input()

if i == "RRR":
    print(3)
elif i == "RRS" or i == "SRR":
    print(2)
elif i == "RSS" or i == "SRS" or "SSR":
    print(1)
else:
    print(0)
s=input()
list_s=list(s)
element="R"
count=0
for i in range(0,len(list_s)-1):
    if(list_s[i] in element):
        if(list_s[i+1] in element):
            count+=2
        else:
            count+=1
    else:
        count+=0
print(count)
S=input()
if S=="RRS":
    print(2)
elif (S=="SSS"):
    print(0)
elif (S=="RSR"):
    print(1)
elif(S=="RRR"):
    print(3)
cnt = 0
t = list(input())
for i in range(len(t)):
    if "R" * i in t:
        cnt = i
print(cnt)
S = str(input())

if S == "RSS" or S == "SRS" or S == "SSR" :
  print("1")
elif S == "RRS" or S == "SRR":
  print("2")
elif S == "RRR":
  print("3")
else :
  print("0")
s=input()
s=str(s)
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)
else:
  print(1)
s = str(input())

if s == 'RRR':
  print(3)
elif (s[::1] == 'RR' or s[1:2] == 'RR'):
  print(2)
elif s != 'SSS':
  print(1)
else:
  print(0)
S = str(input())


if S=="SSS" or S=="RRR":
	print(3)
elif S=="SRS" or S=="RSR":
	print(1)
else:
	print(2)


# 2darray [[0] * 4 for i in range(3)]
# import itertools
def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for i in weathers:
        if weathers[-1] == 'R':
            count += 1
            l_n.append(count)
            
        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 = list(input())

r_cnt = 0
max_r_cnt = 0

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

print(max_r_cnt)
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
            r = 0
print (ans)
import sys

def read_input():
  return sys.stdin.readline().strip().split(' ')

def task(s):
  rainy_til = []
  l = len(s)
  i = 0
  while i < l:
    if s[i] == 'R':
      last_rainy = rainy_til[i-1] if i > 0 else 0
      rainy_til[i] = last_rainy + 1
    else:
      rainy_til[i] = 0
  return max(rainy_til)

def main():
  s = read_input()
  result = task(s)
  print(result)
s = str(input())
ans = 0
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
  else:
    ans = 0
S = list(input())

count = 0
buffer = 'R'
for s in S:
    if s == 'R' and buffer == 'R':
        count += 1
    elif s == 's':
        buffer = 's'
print(count)
S = input()

R_n = 0
R_max = 0
for i in S:
  if i == 'R':
    R_n += 1
  if i == 'S':
    R_max = R_n
    R_n = 0

print(R_max)
s=input()
count=0
flag=True
for char in s:
    if char=='R' and flag:
        count+=1
        flag=False
print(count)
S = input()
if S == "SSS":
    print("0")
elif S == "SSR"or"SRS"or"RSS":
    print("1")
elif S == "SRR"or"RRS":
    print("2")
elif S == "RRR":
    print("3")
s = str(input())
ans = 0
if(s[0]=="R"):
  if(s[1]=="R"):
    if(s[2]=="R"):
      ans = 3
  else:
    ans = 1
else:
  if(s[1]=="R"):
    if(s[2]=="R"):
      ans = 2
    else:
      ans = 1
  else:
    if(s[2]=="R"):
      ans = 1
    else:
      ans = 0
print(ans)
S = input()
count = 0
if S[0] == 'R':
    count += 1
    if S[1] == 'R':
        count += 1
    else:
        exit()
        if S[2] == 'R':
            count += 1
        else:
            exit()
print(count)
S = str(input())


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


# 2darray [[0] * 4 for i in range(3)]
# import itertools
weather = input()
sunny_count = 0

for i in range(3):
  if weather[i] == "S":
    sunny_count += 1
  else:
    continue
    
print(sunny_count)
s = input()

if s == "rrr":
    print(3)
elif s == "rrs" or "srr":
    print(2)
elif s == "rss" or "rsr" or "ssr":
    print(1)
else:
    print(0)
s = list(input().split())

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")
S = input()
cnt = 0
max_cnt = 0
for i in range(len(S)):
  s = S[i]
  if s == 'R':
    cnt += 1
    max_cnt = cnt
  else:
    max_cnt = cnt
    cnt = 0
print(max_cnt)
s=list(input())
s=[str(x) for x in s]
print(s)
count=0
num=0
for i in range(len(s)):
  if (s[i]=='R'):
    count+=1
    if(count==2):
      num+=1
      count=1
  elif (s[i]=='S'):
    count=0
    
print(num)
N = list(input())
if N[0] == 'R' and N[1] == 'R' and N[2] == 'R':
    print(3)
elif N[0] == 'R' and N[1] == 'R' and N[2] == 'S':
    print(2)
elif N[0] == 'S' and N[1] == 'R' and N[2] == 'R':
    print(2)
else:
    print(0)
a = str(input())
anw = 0

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

print(anw)
S=input()
if S=="RSR":
  print(2)
else:
  print(S.count("R"))
s =input()
if s == "RRR":
    print(3)
elif s == "RRS" or "SRR":
    print(2)
elif s == "SSS":
    print(0)
else:
    print(1)
S = input()
ans = 0
r = 0
for c in S:
    if c == 'R':
        r += 1
    else:
        ans = max(ans, r)
        r = 0
print(ans)
S=input()

if S=='RRR':
    print(3)
elif S=='SSS':
    print(0)
elif S=='SRR':
    print(2)
elif S=='RSR':
    print(1)
elif S=='RRS':
    print(2)
elif S=='SSR':
    print(1)
elif S=='SRS':
    print(1)
elif S=='SSR':
    print(1)
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()

# 求解処理
ans = 0
if S == "RRR":
    ans = 3
elif (S == "RRS") or (S == "SRR"):
    ans = 2
elif (S == "RSR") or (S == "SSR") or (S == "SRS") or (S == "SSR"):
    ans = 1
else:
    ans = 0

# 結果出力
print(ans)
s=input()
count=0 
if(s[0]==s[1]==s[2]):
    print('0')
elif(s[0]!=s[1]!=s[2]):
    print('1')
elif(s[0]==s[1] and s[1]!=s[2]):
    print('2')
else:
    print('2')
a = str(input())
anw = 0

for i in a:
    if i == 'R':
        anw += 1
    else:
        anw = 0

print(anw)
# 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)
s=input()

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


else:
    if s[1]=="R":
        cnt+=1
        if s[2]=="R":
            cnt+=1
 
print(cnt)
#A問題

S = input()
if S == "RRR":
    print(3)
    if S == "RRS"or S == "SRR" :
        print(2)
        if S == "SSS":
            print(0)
        else:
            print(1)
S = input()
if S == "RRR":
  print("3")
elif S == "RRS" or "SRR":
  print("2")
elif S == "SSS":
  print("0")
else:
  print("1")
# print(max([len(v) for v in input().split('S')]))

d = {
    'RRR': 5,
    'RRS': 2,
    'RSR': 1,
    'RSS': 1,
    'SRR': 2,
    'SRS': 1,
    'SSR': 1,
    'SSS': 0,
}
print(d[input()])
s = input()

cnt = 0
for i in range(2):
    if s[i] == 'R':
        if s[i+1] == 'R':
            cnt += 1
print(cnt)
print(sum([1 if x == 'R' else 0 for x in input()]))
a = input()
if a == "RRR":
  print(3)
elif a == "RRS" or "RSR" or "SRR":
  print(2)
elif a == "SSS":
  print(0)
else:
  print(1)
s = input()
ans = 0
if s in "R":
    ans = 1
if s in "RR":
    ans = 2
if s in "RRR":
    ans = 3
print(ans)
weather = input()

if weather == "RRR":
  print("3")
  
elif weather == "RRS" or weather == "SRR":
  print("2")
  
elif weather == "SSR" or weather == 'SRS' or weather == 'RSS':
  print("1")
  
else:
  print("0")
S=str(input())
if S[1]=="R":
  if S[2]=="R" and S[0]=="R":
    print(3)
  else:
    if S[0]=="R":
      print(2)
    if S[2]=="R":
      print(2)
else:
  if S[2]=="R" or S[0]=="R":
    print(1)
  else:
    print(0)
s = input()

Rnum=s.count('R')
ans=0
if Rnum==3:
    ans=3
elif Rnum==0:
    ans=0
elif Rnum==2 and s!='RSR':
    ans=2
elif Rnum==1:
    ans=1

print(ans)
S = ("S","S","R")
li = list(S)
count = 0
for num in range(1):
    if li[num] == "R" and li[num+1] == "R" :
        count = count + 1
print(count)
s = input()
if s == "RRR":
    print(3)
if "RR" in s:
    print(2)
elif "R" in s:
    print(1)
else:
    print(0)
import sys
input = sys.stdin.readline

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

main()
s=list(input())
q=0
if s[1]=="R":
    q=1
    if s[0]=="R":
        q+=1
    if s[2]=="R":
        q+=1
else:
    if s[0]=="R" and s[2]=="R":
        q=1
    else:
        q=0
print(q)
S=list(input())
ans=0
for i in range(len(S)-1):
    if S[i]=="R" and S[i+1]=="R":
        ans+=1

print(ans)
def main():
    S = input()
    ans = 0

    if S == "RRR":
        ans = 3
    elif S == "RRS" or S == "SSR":
        ans = 2
    else:
        if S.count("R") != 0:
            ans = 1

    print(ans)

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

if S == "RRR":
    print(3)
elif S == "SSS":
    print(0)
elif S[0:2] == "SS" or S[1:3] == "SS":
    print(1)
else:
    print(2)
import sys

x = input()

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

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

if (S in ("RSS",  "SRS", "SSR")):
    print("1")
elif (S in ("RRS" or "SRR")):
    print("2") 
elif (S == "RRR"):
    print("3")
else:
    print("0")
s = input()

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

count = 0
ans = 0

for i in s:
    if i == 'R':
        count += 1
    if i == 'S':
        if count >= ans:
            ans = count
        count = 0
print(ans)
from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    s = rs()
    ans = 2 if "RR" in s else 1 if "R" in s else 0
    print(ans)    

if __name__ == '__main__':
    main()
s = input()
n = 0 
ans = 0

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

print(ans)
S = input()
T = [S]
if "RR" in S:
  print("2")
elif "R" in S:
  print("1")
else:
  print("0")
S = input()
li = list(S)
count = 0
for num in range(1):
    if li[num] == "R" and li[num+1] == "R" :
        count = count + 1
print(count)
S = str(input())
count= 0

if S[0] == "R" and S[1] == "R" and S[2] == "R":
    print(count+3)
elif S[0] == "R" and S[1] == "R"or S[1] == "R" and S[2] == "R"or S[0] == "R" and S[2] == "R":
    print(count+2)
elif S[0] == "R" or  S[1] == "R"or S[2] == "R":
    print(count+1)
else:
  print(count)
user = input()
if(user == "RRS"):
    print("2")
elif(user == "SSS"):
    print("0")
else:
    print("1")
S=input()
set_S=set(S)
def fun():
    if len(set_S)==1:
        ret=S.count('R')
    elif len(set_S)==2:
        for i in range(2):
            if S[i]==S[i+1]=='R':
                ret=2
                break
            else:
                ret=S.count('R')-1
    return ret

if __name__=='__main__':
    print(fun())
import sys
input = sys.stdin.readline

S=input().strip()

if not ("R" in S):
    print(0)
elif S[1]!="R":
    print(1)
else:
    A=1
    if S[0]=="R":
        A+=1
    elif S[2]=="R":
        A+=1

    print(A)
s=input()
if s=='RRR':
  print(3)
elif s=='RRS' or s=='SRR':
  print(2)
elif s.count('R')==1:
  print(1)
else:
  print(0)
S = list(map(str, input()[0:3].lower()))
res = 0
for i in S:
    if i == "r":
        res += 1
print(res)
#!/usr/bin/env pypy3

def main():
    string = input()
    count = 0
    maxv = -1
    for s in string:
        if s == "R":
            count = count + 1
        else:
            maxv = max(count, maxv)
            count = 0
    print(maxv)

main()
x = input()
ans = 0

if x == 'RRR':
  ans = 3
elif x == 'RRS' or 'SRR':
  ans = 2
elif x == "RSS" or "SRS" or "SSR":
  ans = 1
else:
  ans = 0

print(ans)
S = input()

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

if "RR" in s:
    print(2)
elif "RRR" in s:
    print(3)
elif "R" in s:
    print(1)
else:
    print(0)
#!/usr/bin/env python3

from pprint import pprint
from collections import deque, defaultdict
import itertools
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float('inf')


S = list(input())

res = 0
before = True
for i in range(len(S)):
    if S[i] == 'R':
        if i == 0:
            res += 1
            before = True
        else:
            if before:
                res += 1
    else:
        before = False

print(res)
s = input()
rain = 0
ans = 0
for i in s:
  if i == "R":
    rain += 1
    ans = max(ans, rain)
  else:
    rain = 0
print(rain)
a = input()
if a =='SSS':
  print(0)
elif a=='RSS' or'SRS'or 'SSR'or 'RSR':
  print(1)
elif a == 'RRS'or 'SRR':
  print(2)
else:
  print(3)
import sys
input=sys.stdin.readline

s=input().split()
if s=='RRR':
    print(3)
elif s=='SSS':
    print(0)
elif s=='SRR' or s=='RRS':
    print(2)
else:
    print(1)
s=input()
cnt=0
for i in s:
	if i=="R":
		cnt+=1
	if i=="S":
		break
print(cnt)
s = input()

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

if weather in ["RRR"]:
    print("3")
elif weather in ["SRR","RSR","RRS"]:
    print("2")
elif weather in ["SSR","SRS","RSS"]:
    print("1")
else:
    print("0")
import re
S = input()
mmm = re.findall("RRR", S)
mm = re.findall("RR", S)
m = re.findall("R", S)
if mmm:
    print(3)
elif mm:
    print(2)
else:
    print(1)
S=input()
if S=="RRS" and"SSR" and"SRS" and"RSR":
    print(2)
elif (S=="SSS" and"RRR"):
    print(0)
s = input() + '@'

lst = [1]*len(s)
for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1
print(max(lst))
ss=input()
if ss[0] == ss[1] ==ss[2] == "R":
  print(3)
elif ss[0] == ss[1] == "R" or ss[1]==ss[2] == "R" or ss[2] == ss[0] == "R":
  print(2)
elif "R" in ss:
  print(1)
else:
  print(0)
N = list(input())
if N[0] == 'R' and N[1] == 'R' and N[2] == 'R':
    print(3)
elif N[0] == 'R' and N[1] == 'R' and N[2] == 'S':
    print(2)
elif N[0] == 'S' and N[1] == 'R' and N[2] == 'R':
    print(2)
elif N[0] == 'R' and N[1] == 'S' and N[2] == 'R':
    print(1)
else:
    print(0)
s=input()
count=0
flag=True
if s[0]=='R' and s[1]=='R' and s[2]=='R':
    print(3)
elif ((s[0]=='R' and s[1]=='R') or (s[0]=='R' and s[2]=='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)
s=input()
c=0
ma=0
for i in s:
    if i=="R":
        c+=1
    else:
        ma=max(ma,c)
        c=0
print(ma)
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)
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    max_count = count
    count = 0
    
print(max_count)
S = list(input())
S.append("")
N = len(S)
#X = [[0] for i in range(N+1)]
ans = 0
i = 0
while i < N:
#for i in range(N-1):
    if S[i]=="R":
        ans = 1
        if S[i]==S[i+1]:
            ans += 1
            i += 1
    i += 1
print(ans)
S = input()
if S == "SSS": print(0)
elif S == "RRR": print(3)
elif S == "SSR" or S == "RSS": print(1)
else: print(2)
S = input()
ma = 0
i = 0
m = 0
while(i != len(S)):
  if S[i] == "R":
    m += 1
  
  else:
    ma = max(ma,m)
    m = 0
    break
  i += 1

print(ma)
s = input()

ans = 0

if 'R' in s:
  ans = 1
elif 'RR' in s:
  ans = 2
elif s == 'RRR':
  ans = 3
  
print(ans)
s = input()
if(s[0] == s[1] and s[1] == s[2]):
    print(3)
elif(s[0] == s[1] and s[1] != s[2]):
    print(2)
elif(s[0] != s[1] and s[1] == s[2]):
    print(2)
else:
    print(1)
# rainy season

def rainy(S):
  if 'SSS' in S:
    return 3
  if 'SS' in S:
    return 2
  if 'S' in S:
    return 1
  return 0

if __name__ == "__main__":
  input = list(input().split())
  print(rainy(input[0]))
s = input()
maxCount = 0
count = 0

for i in s:
  if(i == 'r'):
    count += 1
  else:
    maxCount = max(count, maxCount)
    count = 0
    
print(maxCount)
s = input()
if s[0] == s[1] == s[2] == 'R':
    print(3)
if s[0] == s[1] == s[2] == 'S':
    print(0)
elif (s[0] == s[1] == 'R') or (s[1] == s[2] == 'R'):
    print(2)
elif (s[0] == s[2] == 'R'):
    print(1)
else:
    print(0)
S = list(input())

cnt = 0

previous_weather = ''
for i, w in enumerate(S):
  if w == 'R' and i == 0:
    cnt += 1
  elif w == 'R' and w == previous_weather:
    cnt += 1
  previous_weather = w

print(cnt)
string=input()

r=0
for i in range(len(string)-1):
  if string[i]=='R' and string[i+1]=='R':
    r+=1
print(r)
S = input()
c = 0

if S == "RRS" or S == "SRR":
    print("2")
elif S == "RRR":
    print("3")
elif S == "RSR" or S == "RSS" or S == "SSR":
    print("1")
else:
    print("0")
s=input()
if s=="RRR":
    print(3)
elif s=="RR":
    print(2)
elif s=="R":
    print(1)
else: print(0)
text = input()
if text[1] == "S":
    if text[0] == "R" or text[2] == "R":
        print(1)
        quit()
    else:
        print(0)
        quit()
else:
    if text[0] == "R" and text[2] == "R":
        print(3)
        quit()
    elif text[0] == "R" or text[2] == "R":
        print(2)
        quit()
n = input()

num = n.count("R")

if num == 1 or num == 3:
  print(num)
elif num == 2 and n[0] != n[2]:
  print(num)
elif num == 2 and n[0] == n[2]:
  print(1)
S = input()
if S == "SSS":
    print(3)
elif S == "SRR" or S == "RSR" or S == "SSR":
    print(1)
else:
    print(2)
_s = input()
last = _s[0]
cnt = 1
for i in range(1, len(_s)):
	if(_s[i] == last):
		if(_s[i] == 'R'):
			cnt += 1
	last = _s[i]
print(cnt)
def clean(max_r, count):
  if max_r < count:
      max_r = count
  return max_r

mojiretsu = input()
count = 0
max_r = 0
for moji in mojiretsu:
  if moji == 'R':
    count += 1
  else:
    max_r = clean(max_r, count)
    
if count != 0:
  max_r = clean(max_r, count)
  
print(max_r)
r=0
for l in input():
  r+=1 if l=='R' else 0
print(r)
S = input()

if S.count("RRR") == 1 :
    print("3")
elif S.count("RRR") == 1 :
    print("2")
else :
    if S.count("R") >= 1 :
        print("1")
    else :
        print("0")
str = input()
cnt = 0

for i in range(3):
  if str[i] == 'R':
    cnt += 1
print(cnt)
s = str(input()).upper()# S, R == sunny, rainy

def weather(s):
    if s == 'RRR':
        return 0
    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()
lst = list(s)
counter = 0
buffer = 0
if 'R' not in lst:
    print(0)
else:
    for i in range(len(lst) - 1):
        if lst[i] == 'R':
            buffer += 1
        else:
            counter = buffer
            buffer = 0
        if buffer > counter:
            counter = buffer
    print(counter)
S = list(input())
count=0
for i in range(3):
    if S[i-1]=="R":
        count=1
        if S[i-1]==S[i]:
            count+=1
        else:
            count=count
    else:
        count=count
print(count)
a = input()
if a[0] == "R":
    if a[1] == "R":
        if a[2] == "R":
            print("3")
        else:
            print("2")
    else:
        print("1")
elif a[1] == "R":
    if a[2] == "R":
        print("2")
    else:
        print("1")
else:
    print("0")
S = input()

ren = 0

if S[1] == "R":
    if S[0] == "R" and S[2] == "R":
        ren = 3
    elif S[0] == "R" or S[2] == "R":
        ren = 2
elif S[0] == "R" or S[2] == "R":
    ren = 1
    
print(ren)
s = input()
cnt = 0

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

print(cnt)
S=input().strip("¥n")
ans=1
if S[0]==S[1]:
	ans+=1
if S[1]==S[2]:
	ans+=1
	
print(ans)
s = input()
ans = 0
if s == 'SSS':
    print(3)
elif s == 'SSR' or s == 'RSS':
    print(2)
elif s == 'SRR' or s == 'RSR' or s == 'RRS' or s == 'SRS':
    print(1)
else:
    print(0)
b = input()
if 'RSR' == b:
    print(1)
elif 'RRS' == b or 'SRR' == b:
    print(2)
elif 'RRR' == b:
    print(3)
else:
    print(0)
s = list(input())
opt = 0
if (s[0] == 'R'):
    opt += 1
if (s[1] == 'R'):
    opt += 1
if (s[2] == 'R'):
    opt += 1
print(opt)
x=list(input())
cons=0
consecs=[]
b="R"
for a in x:
    if(a=='R' and b==a):
        cons+=1
    else:
        consecs.append(cons)
        cons=0
    b=a
if(consecs==[]):
    consecs.append(cons)
if(max(consecs)!=0):
    print(max(consecs))
else:
    print(0)
s=input()
c=0
for i in s:
  if i=='R':
    c+=1
print(c)
n = list(input())
if n[1] == 'R':
    if n[0] == n[1] and n[1] == n[2]:
        print(3)
    elif n[0] != n[1] and n[1] == n[2]:
        print(2)
    elif n[0] == n[1] and n[1] != n[2]:
        print(2)
    else:
        print(1)
else:
    if n[0] == 'R':
        print(1)
    elif n[1] == 'R':
        print(1)
S = input()

ans = 0
memo = 1
for i in range(3):
    
    if S[i] == "R":
        ans += 1
        memo = 1
    elif S[i] == "S":
        memo = 0

print(ans)
# coding:utf-8
s = input()
count = 0
ans = 0

if s == 'SSS':
    print(0)
elif s == 'SRR':
    print(2)
elif s == 'SSR':
    print(1)
else:
    for i in range(3):
        if s[i] == 'R':
            count += 1
        elif s[i] == 'S':
            ans = count
            count = 0
    print(ans)
import sys
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())


def main():
    s = input()
    cnt = 0
    for i in range(1, 3):
        if s[i] == 'R' and s[i-1] == 'R':
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()
s=input()
c=0
c_max=0
for i in range(3):
  if s[i] == 'R':
    c+=1
  else:
    if c>c_max:
      c_max=c
    c=0
print(c_max)
# A
import re
S = input()
m = re.findall("R", S)
print(len(m))
l = [e for e in input()]
c = 0
if l[1] == "R":
  c += 1
  if l[0] == "R":
    c += 1
  if l[2] == "R":
  	c += 1
else:
  if l[0] == 1 or l[2] == "R":
    c += 1
 
print(c)
N = list(input())

#print(N)

def count(list_1):
    return list_1.count('R')

#print(count(N))
s = input('天気が雨である日が連続していた最大の日数を出力せよ。')
 
if s == "SSS":
    print(0)
elif s == "RRR":
    print(3)
elif s == "RRS":
    print(2)
elif s == "SRR":
    print(2)
else:
    print(1)
from sys import stdin

test = list(stdin.readline().lstrip().rstrip())

count = 0
before = 'R'

for str in test:
    if before == str and str == 'R':
        count = count + 1
    before = str

print(count)
s = input()
cnt=0
for i in range(3):
    if s[i]=='R':
        cnt+=1
print(cnt)
w = list(input().split())

if w == ["RSR"]:
    print(1)

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

def A():
  if s == 'RRR':
    return 3
  if s == 'RRS' or s == 'SRR':
    return 2
  return 1

print(A())