peterverebics/CodeNet_Python_118 huggingface dataset:
s=input()
S=list(s)

num=S.count('R')

if num==2:
    if s=='RSR':
        print("1")
    else:
        print('2')
else:
    print(num)
a = input()

if a =='RRR':
  print(3)
elif 'RR' in a: 
  print(2)
elif 'R' in a: 
  print(1)

else: print(0)
s = input()
if s == "RSR":
  print(1)
else:
  print(s.count("R"))
s =input()
if s == "SSS":
    print(0)
elif s == "SSR" or s == "SRS" or s == "RSS" or s == "RSR":
    print(1)
elif s == "SRR" or s == "RRS":
    print(2)
elif s == "RRR":
    print(3)
import sys

s = input()

ans = 0

for _s in range(3, 0, -1):
    if _s * "R" in s:
        print(_s)
        sys.exit()

print(0)
s=input()
if(s=='RRR'):
  print(3)
elif(s=='RRS' or s=='SRR'):
  print(2)
else:
  s=list(s)
  if 'R' in s:
    print(1)
  else:
    print(0)
S = input()

if S == "RSR":
    ans = 1
else:
    S = list(S)
    ans = S.count("R")

print(ans)
## coding: UTF-8
S = input()

now = 0
ans = 0

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

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()
if S == "RRR":
    print(3)
elif S[:2] == 'RR' or S[1:] == 'RR':
    print('2')
elif S == 'SSS':
    print(0)
else:
    print('1')
import sys


def resolve(in_):
    S = in_.read().strip().split('S')

    ans = max(len(s) for s in S)
    return ans
    

def main():
    answer = resolve(sys.stdin)
    print(answer)


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

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

print(ans)
a=input()

cnt=0

for i in a:
  if i=='R':
    cnt+=1

if cnt==2 and len(a)==3:
  if a[0]=='R' and a[2]=='R':
    cnt=1

print(cnt)
S=input()
if S[0]=='R':
    if S[1]=='R':
        if S[2]=='R':
            print(3)
        else:
            print(2)
    else:
        print(1)
else:
    if S[1]=='R':
        if S[2]=='R':
            print(2)
        else:
            print(1)
    else:
        if S[2]=='R':
            print(1)
        else:
            print(0)
S = input()
res = 0
streak = 0
rs = ""
for s in S:
  if s == 'R':  
    if rs == s:
      res += 1
    else:
      streak = 1
  else:
    streak = 0
  res = max(res, streak)
  rs = s
  
print(res)
s = input()

if s == 'RRR':
  print(3)
elif s == 'SSS':
  print(0)
elif s[:2] == 'RR' or s[1:] == 'RR':
  print(2)
else:
  print(1)
from itertools import groupby
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[0]=="R":
    if S[1]=="R" and S[2]=="R":
        print(3)
    elif S[1]=="R" and S[2]=="S":
        print(2)
    else:
        print(1)
else:
    if S[1]=="R" and S[2]=="R":
        print(2)
    elif S[1]=="S" and S[2]=="S":
        print(0)
    else:
        print(1)
s = input()
res = 0
ans = 0
for i in range(3):
    if s[i] == "R":
        res += 1
    else:
        if ans < res:
            ans = res
        res = 0
if ans < res:
    ans = res
print(ans)
s = input()
if s == 'RSR':
    print(1)
else:
    print(s.count(('R')))
s = input()
if s[0] == s[1] == s[2] == 'R':
    print(3)
elif s[0] == s[1] == 'R' or s[1] == s[2] == 'R':
    print(2)
elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R':
    print(1)
else:
    print(0)
s = input().split('S')
s = sorted(s, reverse=True)
print(len(s[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()
ans = 0
a = 0
for si in s:
    if si == "R":
        a += 1
    else:
        ans = max(ans,a)
        a = 0
print(max(ans,a))
if __name__=="__main__":
    S=input()
    if S=="RRR":
        print(3)
    elif S=="SSS":
        print(0)
    elif S=="RRS" or S=="SRR":
        print(2)
    else:
        print(1)
s=input()
if s=="SSS":print(0)
elif s=="RRS" or s=="SRR":print(2)
elif s=="RRR":print(3)
else:print(1)
s=input()
if "R" in s:
    if s=="RRR":
        print(3)
    else:
        if "RR" in s:
            print(2)
        else:
            print(1)
else:
    print(0)
s = input()

ans=0
if s[0]=='R' and s[1]=='R' and s[2]=='R':
    print(3)
elif s[1]=='R' and s[2]=='R':
    print(2)
elif s[0]=='R' and s[1]=='R':
    print(2)
elif s[0]=='R' or s[1]=='R' or s[2]=='R':
    print(1)
else:
    print(0)
def main():
    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 'R' in s:
        print(1)
    else:
        print(0)
   
if __name__=='__main__':
    main()
#!/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
    maxv = max(count, maxv)
    print(maxv)
 
main()
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)
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math
import bisect

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

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[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:
	if "R" in s:
		print(1)
	else:
		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()
p=S[0]
q=S[1]
r=S[2]

if p == 'R' and q=='R' and r=='R':
    print(3)
elif (p=='R' and q=='R') or  (q=='R' and r=='R') :
    print(2)
elif p=='R'or q=='R' or r=='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")
S = input()
ans = S.count('R')
if ans == 2 and S[1] != 'R':
	ans = 1
print(ans)
s = input()
if s == 'RRR':
    print(3)
elif s[:2] == 'RR' or s[1:] == 'RR':
    print(2)
elif s.count('R') >= 1:
    print(1)
else:
    print(0)
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    S = input()
    res = 0
    cnt = 0
    for s in S:
        if s == "R":
            cnt += 1
            res = max(res, cnt)
        else:
            cnt = 0
    print(res)


if __name__ == '__main__':
    resolve()
# -*- coding: utf-8 -*-
S = str(input())

if S.count("RRR") > 0:
    print(3)
elif S.count("RR") > 0:
    print(2)
elif S.count("R") > 0:
    print(1)
else:
    print(0)
def main():
    s = list(str(input()))
    if s.count('R') == 3:
        print(3)
        return
    elif s.count('R') == 2 and s[1] == 'S':
        print(1)
        return
    elif s.count('R') == 2:
        print(2)
        return
    elif s.count('R') == 1:
        print(1)
        return
    else:
        print(0)
        return
main()
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

s = input()

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

if s in ['SSS']:
    ans = 0
elif s in ['SSR', 'SRS', 'RSS', 'RSR']:
    ans = 1
elif s in ['SRR', 'RRS']:
    ans = 2
else:
    ans = 3

print(ans)
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.count('RRR') != 0:
  print(3)
elif S.count('RR') != 0:
  print(2)
elif S.count('R') != 0:
  print(1)
else :
  print(0)
S = str(input())

if S == 'RRR':
  print(3)
elif S == 'RRS' or S == 'SRR':
  print(2)
elif S == 'SSS':
  print(0)
else:
  print(1)
weather = input()
rainy_count = 0
max_rainy_count = 0

for i in range(3):
  if weather[i] == "R":
    rainy_count += 1
    if max_rainy_count < rainy_count:
        max_rainy_count = rainy_count
    
  else:
    rainy_count = 0
            
print(max_rainy_count)
N = input()
if N == "RRR":
  print(3)
elif N == "SSS":
  print(0)
elif N == "SRR":
  print(2)
elif N == "RRS":
  print(2)  
else:
  print(1)
s = input()

c = 0
r = 0

for i in range(3):
	if s[i] == 'R':
		c += 1
		if r < c:
			r = c
	else:
		c = 0

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

if s[0] == s[1] == s[2] == "R":
    ans = 3
elif s[0] ==s[1] =="R" or s[1] ==s[2] =="R":
    ans = 2
elif "R" in s:
    ans = 1
else:
    ans = 0

print(ans)
s = input()

r = 0
ans = 0
for i in s:
    if i == 'R':
        r += 1
    else:
        ans = max(ans, r)
        r = 0

ans = max(ans, r)
print(ans)
S = input()
ws = [S[0],S[1],S[2]]
max_count = 0
count = 0
for w in ws:
    if w == "R":
        count += 1
        max_count = max(count, max_count)
    else:
        count = 0
print(max_count)
import sys
input = sys.stdin.readline


def print_ans(S):
    """Test Case
    >>> print_ans("RRS")
    2
    >>> print_ans("SSS")
    0
    >>> print_ans("RSR")
    1
    """
    count = 0
    maximum = 0
    for a in S:
        if a == "R":
            count += 1
        else:
            count = 0
        maximum = max(count, maximum)
    print(maximum)


if __name__ == '__main__':
    S = input().rstrip()
    print_ans(S)
s = input()
cnt = 0
R_max = 0
for mozi in s:
    if mozi == "R":
        cnt+= 1
    else:
        R_max = max(cnt,R_max)
        cnt = 0
R_max = max(cnt,R_max)
print(R_max)
def resolve():
    S = input()
    cnt = S.count("R")
    if cnt == 2 and S[1]=="S":
        print(1)
    else:
        print(cnt)

    
if '__main__' == __name__:
    resolve()
def main():
    s = input()

    maxren = 0
    ren = 0
    for c in s:
        if c == "R":
            ren += 1
            maxren = max(maxren, ren)
        else:
            ren = 0
    print(maxren)


main()
s = input("")
Scnt = 0
Smem = 0

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

if Scnt == 3:
    print(0)
elif Scnt == 2:
    print(1)
elif Scnt == 0:
    print(3)
elif Scnt == 1 and Smem == 1:
    print(1)
elif Scnt == 1 and Smem != 1:
    print(2)
a=input()
con=0
count=0
for i in range(3):
    if a[i]=='R' and i==2:
        count+=1
        con=max(con,count)
    elif a[i]=='R':
        count+=1
    else:
        con=max(con,count)
        count=0
print(con)
s = input()

answer = 0
count = 0
for i in range(len(s)):
  if s[i] == "R":
    count += 1
    if i == len(s)-1 :
      if count > answer :
        answer = count  
  else :
    if count > answer :
      answer = count
    count = 0
  
print(answer)
w=list(input())

if not "R" in w:
    print(0)
elif not "S" in w:
    print(3)
else:
    if w[1]=="R" and (w[0]=="R" or w[2]=="R"):
        print(2)
    else:
        print(1)
s = str(input())
ans = 0
num = 0
for i in range(len(s)):
  if s[i] == "R":
    num += 1
  else:
    ans = max(ans,num)
    num = 0
print(max(ans,num))
s = input()

sc = s.count('S')


if sc == 0:
    print(3)
if sc == 2:
    print(1)
if sc == 3:
    print(0)

if sc == 1:
    if s[1] == 'S':
        print(1)
    else:
        print(2)
s=input()

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

if s == "RRR":
    ans = 3
elif s == "SSS":
    ans = 0
elif s == "RRS" or s == "SRR":
    ans = 2
else:
    ans = 1
print(ans)
import sys
readline = sys.stdin.readline

S = readline().strip()

ans = 0
con = 0
for i in range(3):
  if S[i] == "R":
    con += 1
    if con > ans:
      ans = con
  else:
    con = 0
print(ans)
s = input()

if s.count("R")==2 and s[1]=="S":
    print(s.count("R")-1)
else:
    print(s.count("R"))
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

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

count = 1

for i in range(len(s)-1):
  if s.count("R") == 0:
    count = 0
  elif s[i] == "R" and s[i+1] == "R":
    count += 1
    
print(count)
S=input()
s=[input() for i in range(0,0)]

a=S.count('RRR')
b=S.count('RR')
c=S.count('R')

if a==1:
    x=3
else:
    if b==1:
        x=2
    elif c!=0:
        x=1
    else:
        x=0

print(x)
s = input()


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

seq = 0
prev = False
for i in range(3):
    if weather[i] == 'R':
        if prev:
            seq += 1
            prev = True
        else:
            seq = 1
            prev = True
    else:
        prev = False
            
print(seq)
#!/usr/bin/env python3
S = input()

if S=='RRR':
    print(3)
elif S=='RRS' or S=='SRR':
    print(2)
elif S.count('R') == 1 or S=='RSR':
    print(1)
else:
    print(0)
s = input()
record = list(s)
n = 0
high_score = 0
yesterday = ' '
for today in record :
    if today == 'R':
        if yesterday == 'R' :
            n += 1
        else :
            n = 1
    if high_score < n :
        high_score = n
    yesterday = today
print(high_score)
#!/usr/bin/env python3

s = input()
if s == 'RRR':
    print(3)
    exit()
elif s == 'RRS' or s == 'SRR':
    print(2)
    exit()
elif s == 'RSR' or s == 'SRS' or s == 'RSS' or s == 'SSR':
    print(1)
    exit()
else:
    print(0)
    exit()
s=input()
arr=[]
for i in s:
    arr.append(i)
brr=[]
count=0
for i in arr:
    if(i=='S'):
        brr.append(count)
        count=0
    if(i=='R'):
        count=count+1 
brr.append(count)
print(max(brr))
#coding:utf-8

s = str(input())

count = 0
ans = 0

for i in s:
    if i == "R":
        count += 1
    elif i == "S":
        count = 0
    ans = max(ans,count)

print("{}".format(ans))
s = input()
answer  = 0
current = 0
for ch in s:
    if ch == "R":
        current += 1
    else:
        current = 0
    answer = max(answer, current)
 
print(answer)
# A - Rainy Season

s = input()
for p in ('RRR', 'RR', 'R', ''):
    if p in s:
        print(len(p))
        exit()
S = str(input())
ans = 0
if 'R' in S:
    ans = 1
    if 'RR' in S:
        ans = 2
        if 'RRR' in S:
            ans = 3
print(ans)
s = input("")
n = 0

if s[0] == "R":
    if s[1] == "R":
        if s[2] == "R":
            n = 3
        else:
            n = 2
    else:
        n = 1

elif s[1] == "R":
    if s[2] == "R":
        n = 2
    else:
        n = 1

elif s[2] == "R":
    n = 1

else:
    n = 0

print(n)
S = input()

cnt = 0

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

if cnt >= 2 and S[1] == "S":
    cnt = 1

print(cnt)
S = str(input())

if S[0]=='R':
	if S[1]=='R':
		if S[2]=='R':
			print(3)
		else:
			print(2)
	else:
		print(1)
else:
	if S[1]=='R':
		if S[2]=='R':
			print(2)
		else:
			print(1)
	else:
		if S[2]=='R':
			print(1)
		else:
			print(0)
S = input()
if S.count('RRR') == 1:
    print(3)
elif S.count('R') == 2 and S.count('RR') == 1:
    print(2)
elif S.count('R') >= 1 and S.count('R') < 3 and S.count('RR') == 0:
    print(1)
else:
    print(0)
l=input().split("S")
out=0
for i in l:
    if len(i)>out:
        out=len(i)
print(out)
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)
weather = input()
rainyDay = weather.count('R')
if rainyDay < 2:
    print(rainyDay)
else:
    if weather[1] == 'R':
        print(rainyDay)
    else:
        print(1)
s = input()

if s == 'RSR':
  print (1)
else:
  print (s.count('R'))
s = input()
flag = 1
ans = 0
tmp = 0

for i in range(3):
    if s[i] == "R":
        tmp += 1
    else:
        tmp = 0
    ans = max(tmp, ans)

print(ans)
a=input()

c=3

while True:
    
    if "R"*c in a :
        print(c) 
        break
        
    c-=1
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=='RSS':
    print(1)
s = input()
ans = 0
memo = 0
for i in s:
	if i=="R":
		memo += 1
		ans = max(memo, ans)
	else:
		memo = 0
print(ans)
s=str(input())
count=0
res=0
for i in range(3):
    if s[i]=="R":
        count+=1
        res=count
    else:
        count=0

print(res)
str = input()

if str == "RRR":
  ans = 3
elif str == "RRS" or str == "SRR":
  ans = 2
elif str == "SSS":
  ans = 0
else:
  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 S == 'SSS':
  print(0)
  
else:
  print(1)
S=input()
c=S.count('R')
if c==1:
    print(1)
elif c==0:
    print(0)
elif c==3:
    print(3)
else:
    if S[1]=='R':
        print(2)
    else:
        print(1)
S = input()
count=0
ans=0
for i in S:
    if(i=='R'):
        count+=1
    else:
        ans =max(ans,count)
        count = 0
print(max(ans,count))
s = input().strip()
best = 0
streak = 0
for c in s:
    if c == 'R':
        streak += 1
        best =  max(best, streak)
    else:
        streak = 0
print(best)
s = input()

ans = 0

if s == "RRR" :
    ans = 3
elif s == "SRR" or s == "RRS" :
    ans = 2
elif s == "SSS" :
    ans = 0
else :
    ans = 1

print(ans)
s=str(input())
streak=0
ans=0
for ch in s:
    if ch=='R':
        streak+=1
    else:
        ans=max(ans, streak)
        streak=0
ans=max(ans, streak)
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)
from sys import stdin


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

count = [0,0,0]
i=0
before = 'R'

for str in test:
    if str=='R':
        count[i] += 1
    else:
        i = i + 1

print(max(count))
s=input()
if 'RRR'in s:
  print(3)
elif 'RR' in s:
  print(2)
elif 'R' in s:
  print(1)
else:
  print(0)
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    s=STR()
    ans=0
    temp=0
    for i in s:
        if i=='R':
            temp+=1
            ans=max(temp,ans)
        else:
            temp=0
    print(ans)
    
if __name__ == '__main__':
    do()
w = list(input())
out = 0
cnt = 0
for i in range(len(w)):
    if w[i] == "S":
        cnt = 0
    elif w[i] == "R":
        cnt += 1
        out = max(out, cnt)
print(out)
S = input()

ans = [0]
for i in range(len(S)):
    if S[i] == "R":
        ans.append(ans[-1] + 1)
    else:
        ans.append(0)
print(max(ans))
S=str(input())

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

print(ans)
S = input()

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

ans = 0
if s == 'RRR':
    ans = 3
elif s == 'RRS' or s == 'SRR':
    ans = 2
elif s == 'SSS':
    ans = 0
else:
    ans = 1

print(ans)
s=input()
if s=="RRR":
    print(3)
elif s=="SSS":
    print(0)
elif s=="RSS" or s=="SRS" or s=="SSR" or s=="RSR":
    print(1)
else:
    print(2)
s = input()

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

if x == "RRR":
    print(3)
elif x == "RRS":
    print(2)
elif x == "SRR":
    print(2)
elif x == "SSS":
    print(0)
else:
    print(1)
s = input()
mx = 0
cnt = 0
f = True
for i in range(len(s)):
    if f:
        if s[i] == "R": cnt += 1
        else:
            f = False
            mx = max(mx, cnt)
    else:
        if s[i] == "R":
            f = True
            cnt = 1
print(max(mx,cnt))
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = read().rstrip().decode()

def solve(x):
    if x.count('RRR'):
        return 3
    if x.count('RR'):
        return 2
    if x.count('R'):
        return 1
    return 0

print(solve(x))
s = input()
cnt=0
res=0
for i in range(len(s)):
  if s[i]=='R':
    cnt+=1
  else:
    res=max(res,cnt)
    cnt=0
    
print(max(res,cnt))
s = input()

for i in [3, 2, 1, 0]:
    if 'R'*i in s:
        print(i)
        break
S = input()
if S == 'SSS':
  a = 0
if S == 'SSR':
  a = 1
if S == 'SRS':
  a = 1
if S == 'SRR':
  a = 2
if S == 'RSS':
  a = 1
if S == 'RSR':
  a = 1
if S == 'RRS':
  a = 2
if S == 'RRR':
  a = 3
print(a)
S=input()

ans=0

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

if ans==2 and S[1]=="S":
    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[0] == "R":
    if s[1] == "R":
        if s[2] == "R":
            print("3")
        else:
            print("2")
    else:
        print("1")
            
elif s[1] == "R":
    if s[2] == "R":
        print("2")
    else:
        print("1")
elif s[2] == "R":
        print("1")
else:
    print("0")
S = input()
r = S.count("R")
if r == 0:
    print(0)
elif r == 1:
    print(1)
elif r == 3:
    print(3)
elif r == 2:
    if S == "RSR":
        print(1)
    else:
        print(2)
a=list(input())
cnt=0
ans=0
for i in a:
  if i=="R":
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
ans=max(cnt,ans)
print(ans)
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 == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
else:
    for i in range(3):
        if s[i] == "R":
            print(1)
            break
        elif i == 2:
            print(0)
s = input()
if 'RRR' in s:
    a = 3
elif 'RR' in s:
    a = 2
elif 'R' in s:
    a = 1
else:
    a = 0
print(a)
s = input()
if 'SSS' == s:
    print(0)
elif 'RSS' == s:
    print(1)
elif 'RRS' == s:
    print(2)
elif 'RRR' == s:
    print(3)
elif 'SSR' == s:
    print(1)
elif 'SRR' == s:
    print(2)
elif 'SRS' == s:
    print(1)
elif 'RSR' == s:
    print(1)
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = read().rstrip().decode()

def solve(x):
    if x.count('RRR'):
        return 3
    elif x.count('RR'):
        return 2
    elif x.count('R'):
        return 1
    else:
      return 0

print(solve(x))
S = input()
if 'RRR' in S:
  print(3)
  exit()
if 'RR' in S:
  print(2)
  exit()
if 'R' in S:
  print(1)
  exit()
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)