We have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.
Find the maximum number of consecutive rainy days in this period.

-----Constraints-----
 - |S| = 3
 - Each character of S is S or R.

-----Input-----
Input is given from Standard Input in the following format:
S

-----Output-----
Print the maximum number of consecutive rainy days in the period.

-----Sample Input-----
RRS

-----Sample Output-----
2

We had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.

Difficulty: introductory

Starter code:

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

str = input()

cnt = str.count('R')

if cnt == 3:
    print((3))
elif cnt == 2:
    if str[0] == str[2]:
        print((1))
    else:
        print((2))
elif cnt == 1:
    print((1))
else:
    print((0))


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

S = input()
ans = 0
if S == "SSS": ans = 0
elif S == "SSR": ans = 1
elif S == "SRS": ans = 1
elif S == "RSS": ans = 1
elif S == "SRR": ans = 2
elif S == "RSR": ans = 1
elif S == "RRS": ans = 2
else: ans = 3

print(ans)

S = input()
for i in range(3,0,-1):
    if 'R'*i in S:
        print(i)
        break
else:
    print(0)

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

  return
      
main(s)

def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7

#import numpy as np
import sys
import math
import collections

s = input()
cnt = 0
pre = 1
ma = 0
for i in range(3):
    if s[i] == 'R' and pre == 1:
        cnt += 1
    elif s[i] == 'R' and pre == 0:
        pre = 1
        cnt = 1
    else:
        cnt = 0
        pre = 0
    ma = max(cnt,ma)
print(ma)

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 "R" in s:
    if s[0] == s[1] or s[1] == s[2]:
        ans = s.count("R")
    else:
        ans += 1
print(ans)


def main():
	S = input()
	r_max = 0
	r = 0
	for i in range(len(S)):
		if S[i] == "R":
			r += 1
			r_max = max([r, r_max])
		else:
			r = 0
	print(r_max)

main()

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


S = str(input())
ans = 0
if S[0] == "R":
	ans += 1
	if S[1] == "R":
		ans += 1
		if S[2] == "R":
			ans += 1
elif S[0] != "R" and S[1] == "R":
	ans +=1
	if S[2] == "R":
		ans += 1
elif S[0] != "R" and S[1] != "R" and S[2] == "R":
	ans += 1
elif S[0] == S[1] == S[2] != "R":
	ans = 0

print(ans)

str = input()

#直前の文字が雨か判定するフラグ
flg = False
#連続count数
count = 0
#最大count数
max = 0

for s in str:
  if s == 'R':
    if flg == True:
      count += 1
      if max < count:
        max = count
    else:
      flg = True
      count += 1
      if max < count:
        max = count
  else:
    flg = False
    count = 0

print(max)


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


s = input()
j = 0
ren = 0
for num in range(3):
    if s[num] == "R":
            if ren == 1:
                j += 1
            else:
                j = 1
            ren = 1
    else:
        ren = 0
print(j)


t = input()
n = list(t)
if n[1] == "S":
    if n[0] == "S":
        if n[2] == "R":
            print(1)
        else:
            print(0)
    else:
        print(1)
else:
    if n[0] == "S":
        if n[2] == "R":
            print(2)
        else:
            print(1)
    else:
        if n[2] == "R":
            print(3)
        else:
            print(2)

s=input()
if s[1]=="S":
    if s[0]=="S" and s[2]=="S":
        print(0)
    else:
        print(1)
else:
    print(s.count("R"))

s = input()
ans = s.count('R')

if s == 'RSR':
    ans = 1

print(ans)


S=input();print(max(n*(n*"R"in S)for n in[1,2,3]))

S=input()
cnt=0
if S[0]=='R':
    cnt+=1
    if S[1]=='R':
        cnt+=1
        if S[2]=='R':
            cnt+=1
        else:
            pass
else:
    if S[1]=='R':
        cnt+=1
        if S[2]=='R':
            cnt+=1
        else:
            pass
    else:
        if S[2]=='R':
            cnt+=1

print(cnt)

s = input()

c = 0
c_max = 0
for i in s:
    # print(i)
    if i == 'R':
        c += 1
    else:
        c_max = max(c_max, c)
        c = 0
    c_max = max(c_max, c)


print(c_max)


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()
count = 0
ans = 0
for i in s:
    if i == 'R':
        count += 1
    else:
        count = 0
    ans = max(ans, count)
print(ans)

S=input()
S_list=list(S)
if S[0]!=S[1] and S[1] != S[2]:
    print(1)
else:
    print(S_list.count("R"))

#d,t,s = list(map(int, input().split()))
s = input()

l,r = [False,False]

if s[0] == s[1] and s[0] == 'R':
	l = True
if s[1] == s[2] and s[1] == 'R':
	r = True

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



A=input()
count=0
ma=0
for i in A:
  if i == 'R':
    count+=1
  else:
    count=0
  if count>ma:
    ma = count
print(ma)    

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)
else:
    print(0)

S = input()
ans = 0
if 'RRR' in S:
    ans += 3
elif 'RR' in S:
    ans += 2
elif 'R' in S:
    ans += 1
print(ans)

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

s = str(input())
p = s[0] == "R"
q = s[1] == "R"
r = s[2] == "R"

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

S=input()
ans=0
cnt=0
for s in S:
    if s=="S":
        ans=max(ans,cnt)
        cnt=0
    else:
        cnt+=1
ans=max(ans,cnt)
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)

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

s = input()
cnt = s.count("R")
if s[1] == "R":
	print(cnt)
else:
	print(min(cnt,1))	

import sys

S = input()

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

print(ans)

s = input()
cnt = 0
if 'R' in s:
    if s[0] == s[1] or s[1] == s[2]:
        cnt = s.count('R')
    else:
        cnt += 1
print(cnt)

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

x=input()
x=list(x)
i=0
ans=0
out=ans
while(i!=len(x)):
    if i==0:
        if x[i]=="R":
            ans=1
            out=ans
    else:
        if x[i]==x[i-1]:
            if x[i]=="R":
                ans+=1
                out=max(ans,out)
            else:
                ans=0
        else:
            if x[i]=="R":
                ans=1
                out=max(ans,out)
            else:
                ans=0
    i+=1
print(out)


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

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

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

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 == 'RSR' or 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()
if 'RRR' in S:
    print(3)
elif 'RR' in S:
    print(2)
elif 'R' in S:
    print(1)
else:
    print(0)

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


def __starting_point():
    main()

__starting_point()

import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

s = rs()
if s == 'RRR':
    a = 3
elif s[:2] == 'RR' or s[1:] == 'RR':
    a = 2
elif s == 'SSS':
    a = 0
else:
    a = 1
print(a)

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=str(input())
x=x.replace("RRR","k")
if "k" in x:
	print(3)
else:
	x=x.replace("RR","k")
	if "k" in x:
		print(2)
	else:
		x=x.replace("R","k")
		if "k" in x:
			print(1)
		else:
			print(0)

s = input()

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

n = input()
count = 0

if 'R' in n:
    if n[0] == n[1] or n[1] == n[2]:
        count = n.count('R')
    else:
        count+=1

print(count)

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()
print()
if s == 'SSS':
  print(0)
if s == 'SSR':
  print(1)
if s == 'SRS':
  print(1)
if s == 'RSS':
  print(1)
if s == 'RRS':
  print(2)
if s == 'RSR':
  print(1)
if s == 'SRR':
  print(2)
if s == 'RRR':
  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')

S = input()

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

s = input()

count = 0
for i in range(3):
  if s[i] == "R":
    if count == 0:
      count += 1
    elif s[i - 1] == "R":
      count += 1
print(count)

# coding: utf-8
# Your code here!
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()

d1, d2, d3 = 0, 0, 0

if S[0] == 'R':
    d1 = 1
if S[1] == 'R':
    d2 = 1
if S[2] == 'R':
    d3 = 1
    
print(d2 and (d1 + d2 + d3) or not d2 and (d1 or d3))

s = 0
wealth = input()
for i in wealth:
    if  i == 'R':
        s = s + 1
    if s>=2 and wealth[1] == 'S':
        s = 1
print((int(s)))


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:
    print(3)
elif 'RR' in s:
    print(2)
elif 'R' in s:
    print(1)
else:
    print(0)

def main():
    s = input()
    cnt = s.count("R")
    if s[1] == "R":
        print(cnt)
    else:
        print(min(cnt,1))
    return

def __starting_point():
    main()
__starting_point()

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


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

from collections import Counter
s=input()
c=0
p=0
cd=0
for i in range(len(s)):
  if s[i] == 'R' and (p==0 or c!=0):
    c+=1
    p=1
  else:
    cd=max(cd,c)
    c=0
print(max(cd,c))

import collections

S = input()

RainyDay = S.count("R")

if(RainyDay == 2 and S[1] == "S"):
    RainyDay = 1

print(RainyDay)

N=input()
s=list(N)
if s[0]==s[1]==s[2]=='R':
    print((3))
elif ((s[0]==s[1]=='R') and (s[2]=='S')) or((s[2]==s[1]=='R') and (s[0]=='S')):
    print((2))
elif s[0]==s[1]==s[2]=='S':
    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()
a0 = ["SSS"]
a1 = ["RSS", "SRS", "SSR", "RSR"]
a2 = ["RRS", "SRR"]
a3 = ["RRR"]
if s in a0:
    ans = 0
elif s in a1:
    ans = 1
elif s in a2:
    ans = 2
else:
    ans = 3
print(ans)

n=input()
renzoku=0
ans=0
for i in n:
    if i=="R":
        renzoku+=1
        ans=max(renzoku,ans)
    else:
        renzoku=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)

S = input()

if "R" in S[0] == "R" in S[1] == "R" in S[2]:
    print((3))
elif "R" in S[0] == "R" in S[1] or "R" in S[1] == "R" in S[2]:
    print((2))
elif "R" in S[0] or "R" in S[1] or "R" in S[2]:
    print((1))
else:
    print((0))
    


S = input()

if(S.count('R')==3) or (S.count('R')==1) or (S.count('R')==0):
  print(S.count('R'))
else:
  if(S[0]==S[2]):
    print('1')
  else:
    print('2')

S = input()
ans = 0
if "R" in S:
    if S[0] == S[1] or S[1] == S[2]:
        ans = S.count("R")
    else:
        ans += 1
print(ans)

from sys import stdin
S = stdin.readline().rstrip()
if S == 'RSR':
    ans = 1
else:
    ans =  S.count('R')
print(ans)

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)

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

input_data = input()
counts = []
count = 0

for i in range(3):
  if input_data[i] == "R":
    count += 1
  else:
    counts.append(count)
    count = 0

counts.append(count)

counti = max(counts)
print(counti)

def main():
    S = input()
    flag = 0
    cnt = 0
    maxC = 0
    
    for i in range(len(S)):
        if S[i] == "S":
            flag = 0
            continue
        elif flag == 0:
            cnt = 1
            flag = 1
        else:
            cnt += 1
            
        if maxC < cnt:
            maxC = cnt
    
    print(maxC)
    
def __starting_point():
    main()
__starting_point()

s = input()

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

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


r=input()
if r=='RRR':
  print('3')
elif r=='SRR' or r=='RRS':
  
 # print(r)
  print('2')
elif r=='SSS':
  print('0')
else:
  print('1')

weather = input()

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


S = input()
if S[0] == S[1] == S[2] == "R":
    print(3)
elif S[1] == S[2] =="R" or S[1] == S[0] == "R":
    print(2)
elif "R" in set(list(S)):
    print(1)
else:
    print(0)

s = input()
if 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)
elif s == 'SSS':
    print(0)

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

S = input()

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

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

s=input()
r=s.count("R")
if r==2 and s[1]=="S":
  print((1))
else:
  print(r)


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


s = input()

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

if s == 'SSR' or s == 'SRS' or s == 'RSS' or s == 'RSR':
    print(1)

if s == 'SRR' or s == 'RRS':
    print(2)

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

# SSS 0
# SSR 1
# SRS 1
# SRR 2
# RSS 1
# RSR 1
# RRS 2
# RRR 3
# 8toori 


S = input()

cnt = 0
ans = 0

for i in range(len(S)):
    # range 回すたびに１つカウントが上がってiに代入される
    # len 文字数を数える
    if S[i] == 'R':
        cnt = cnt + 1
        if ans < cnt:
            ans = cnt
    else:
        cnt = 0

print(ans)


s=input()
a = 0

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

print(a)

def main():
    s = input()
    cnt = s.count('R')
    if(cnt == 2 and s[1] != 'R'):
        print("1")

    else:
        print(cnt)

def __starting_point():
    main()
__starting_point()

S = input()

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


print(max(map(len,input().split("S"))))

S = input()
n_S = len(S)
state_r = 0
ma = 0

for i in range(n_S):
    if S[i] == 'R':
        state_r += 1
    else:
        state_r = 0
    ma = max(ma, state_r)

print(ma)


S = input()
count = 0
L = []
for i in range(len(S)):
    if S[i]=='R':
        count += 1
        L.append(count)
    else:
        count = 0
        L.append(count)
print((max(L)))


s = input()

a = s[0]
b = s[1]
c = s[2]

if a == "S" and b == "S" and c == "S":
    print("0")

elif ((a != "S" and b == "S" and c == "S")    
    or (a == "S" and b == "S" and c != "S")
    or (a == "S" and b != "S" and c == "S")
    or (a != "S" and b == "S" and c != "S")):

    print("1")

elif ((a != "S" and b != "S" and c == "S")
    or (a == "S" and b != "S" and c != "S")):

    print("2")

else:
    print("3")

s = input()
print((3 if s == 'RRR' else 2 if s == 'RRS' or s == 'SRR'
       else 1 if s == 'RSS' or s == 'SRS' or s == 'RSR' or s == 'SSR' else 0))


s = list(input())
count = 0
maximum = 0
while s:
  if s.pop() == 'R':
    count += 1
  else:
    maximum = max(maximum,count)
    count = 0
print(max(count,maximum))