Problem:
 Score : 100 points    Problem Statement 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 1 RRS      Sample Output 1 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 .       Sample Input 2 SSS      Sample Output 2 0  It was sunny throughout the period. We had no rainy days, so we should print 0 .       Sample Input 3 RSR      Sample Output 3 1  We had rain on the 1 -st and 3 -rd days - two "streaks" of one rainy day, so we should print 1 .

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

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

Solution (Python):
s=input()
c1="RRR"
c2="RR"
c3="R"
if c1 in s:
    print(3)
elif c2 in s:
    print(2)
elif c3 in s:
    print(1)
else:
    print(0)

Solution (Python):
W = input()
cnt = 0
max_cnt = 0
for i in range(3):
    if W[i] == 'S':
        cnt = 0
    else:
        cnt += 1
        max_cnt = max(max_cnt, cnt)

print(max_cnt)

Solution (Python):
def main():
    s = input()
    cnt = 0
    cnt2 = 0
    for i in s:
        if i == "R":
            cnt2 += 1
        else:
            cnt = max(cnt, cnt2)
            cnt2 = 0
    print(max(cnt, cnt2))


main()

Solution (Python):
s = input()
if s == 'RRR': print(3)
elif s == 'SSS': print(0)
elif s[0:2] == 'RR': print(2)
elif s[1:3] == 'RR': print(2)
else: print(1)

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    
    
    
    s = input()
    cnt = s.count('R')
    if cnt == 2 and s[1] == 'S':
        print(1)
    else:
        print(cnt)


if __name__ == "__main__":
    main()

Solution (Python):
n = input()
count = 0
mx = 0
for i in range(len(n)):
  if n[i] == "R":
    count +=1
  else:
    count = 0
  mx = max(mx,count)
print(mx)

Solution (Python):
s = input()
count = 0
res = 0
for ele in s:
  if ele == 'R':
    count += 1
  else:
    count = 0
  res = max(res, count)
print(res)

Solution (Python):
str=input()
if(str[0]=='R' and str[1]=='R' and str[2]=='R'):
    print(3)
elif(str[1]=='R' and (str[0]=='R' or str[2]=='R')):
    print(2)
elif(str[0]=='R' or str[1]=='R' or str[2]=='R'):
    print(1)
else:
    print(0)

Solution (Python):
S = input()
R_check = lambda x: 1 if x=="R" else 0
rain_flg = list(map(R_check, S))
if sum(rain_flg) == 2:
  if rain_flg[1] == 0:
    print(1)
  else:
    print(2)
else:
  print(sum(rain_flg))

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

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

Solution (Python):
s = str(input())
s=s.lower()

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

Solution (Python):
a=lambda x:x.count("R") if x.count("R") in{0,1,3}else 1 if x=="RSR"else 2
print(a(input()))

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

Solution (Python):
s = input()

if s.count('RRR') == 1:
    print(3)
elif s.count('RR') == 1:
    print(2)
elif s.count('R') >= 1:
    print(1)
elif s.count('R') == 0:
    print(0)

Solution (Python):
def solve():
  S = input()
  if 'RRR' in S:
    return 3
  if 'RR' in S:
    return 2
  if 'R' in S:
    return 1
  return 0
print(solve())

Solution (Python):
s = input()
res = 0

for i in range(3):
    if s[i] == 'R':
        res = 1
if s[0] == 'R' and s[1] == 'R':
    res += 1
if s[1] == 'R' and s[2] == 'R':
    res += 1

print(res)

Solution (Python):
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
INT_MIN=-10**13
import bisect as B

s=input()

cr=0
cs=0
for i in range(len(s)):
    if s[i]=="R":
        cr+=1
    else:
        cs+=1

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

Solution (Python):
S = input()

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

Solution (Python):
s=input()
c=0
for i in range(3):
  if s[i]=="R":
    c+=1
if c<2 or c==3: print(c)
else:
  if s[1]=="R": print(2)
  else: print(1)

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

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

Solution (Python):
n = input()

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

Solution (Python):
S = input()
if S == "RRR":
  print(3)
elif S == "RRS" or S =="SRR":
  print(2)
elif S == "SSS":
  print(0)
else:
  print(1)

Solution (Python):



S=input()
if S=="RRR":
    print(3)
    exit()
if S=="SRR" or S=="RRS":
    print(2)
    exit()
if S=="SSS":
    print(0)
    exit()
else:
    print(1)

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

Solution (Python):
x = input()
if x == 'SSS':
  print(0)
elif 'SS' in x:
  print(1)
elif 'RRR' in x:
  print(3)
elif 'SRS' in x or 'RSR' in x:
  print(1)
else:
  print(2)

Solution (Python):



S=input()

ans=0

for i in range (len(S)):
    if S[i]=="R":
        tempans=1
        for j in range (i+1,len(S)):
            if S[i]==S[j]:
                tempans+=1
            else:
                if tempans>ans:
                    ans=tempans
                break
        else:
            if tempans>ans:
                ans=tempans
print(ans)

Solution (Python):
S = input()


    

    

rs = S.split('S')
ans = 0
for r in rs:
    ans = max(ans, len(r))
print(ans)

Solution (Python):
import sys
input = sys.stdin.buffer.readline




def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))



def main():
	s=RD()
	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)




if __name__ == "__main__":
	main()

Solution (Python):
s = input()
cnt = 0
if s.count('R') == 3:
  print(3)
  exit()
elif s[1] == 'R' and (s[0] == s[1] or s[1] == s[2]):
  print(2)
  exit()
elif s.count('R') >= 1:
  print(1)
  exit()
else:
  print(0)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S = input().strip()

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


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
ans = 0
cnt = 0
for i in range(3):
    if s[i] == 'S':
        cnt = 0
    else:
        cnt += 1
    ans = max(ans, cnt)
print(ans)

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

Solution (Python):
cnt = 0
ans = 0
S = input()
for i in S:
    if i == 'R':
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0

print(ans)

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

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

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

Solution (Python):
S=input()
if S=="RSR":
  print(1)
else:
  print(S.count("R"))

Solution (Python):
print(len(max(input().split('S'))))

Solution (Python):


s = input()

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

Solution (Python):
s=input();print(sum("R"*i in s for i in range(1,4)))

Solution (Python):
s=input()

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

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

Solution (Python):
input_weather = input()
if input_weather.count('RRR') == 1:
	print(3)
elif input_weather.count('RR') == 1:
    print(2)
elif input_weather.count('R') >= 1:
    print(1)
else :
    print(0)

Solution (Python):
a=input()
f=[0]*3
for i in range(3):
  if a[i]== 'R':
    if i ==0:
      f[0]=1
    else:
      f[i]=f[i-1]+1
  else:
    f[i]=0
print(max(f))

Solution (Python):



S=input()
if S=="RRR":
    print(3)
    exit()
if S=="SRR" or S=="RRS":
    print(2)
    exit()
if S=="SSS":
    print(0)
    exit()
else:
    print(1)

Solution (Python):
s = input()
ans = 0
p = 0
for i in range(3):
    if s[i] == 'R':
        p += 1
    else:
        ans = max(ans,p)
        p = 0
print(max(ans,p))

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

Solution (Python):
s=input()
if s=="RRR":
  print(3)
elif s=="SSS":
  print(0)
elif "RR" in s:
  print(2)
else:
  print(1)

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

Solution (Python):
s = input()

for i in [3, 2, 1, 0]:
    if 'R' * i in s:
        print(i)
        break

Solution (Python):
st = input()
if st[0] == st[1] and st[0] == st[2] and st[0] == "R":
  print(3)
elif (st[0] == st[1] and st[0] == "R") or (st[1] == st[2] and st[1] == "R"):
  print(2)
elif "R" in st:
  print(1)
else:
  print(0)

Solution (Python):
s = input()
ans = 0

for i in range(1, 4):
    p = "R" * i
    if p in s:
        ans = i

print(ans)

Solution (Python):
from math import *
import sys,bisect,copyreg,copy,statistics,os
def inp(): return sys.stdin.readline().strip()
def IIX(): return (int(x) for x in sys.stdin.readline().split())
def II(): return (int(inp()))
def LI(): return list(map(int, inp().split()))
def LS(): return list(map(str, inp().split()))
def L(x):return list(x)
def out(var): return sys.stdout.write(str(var))
def binary_search(arr, x): 
    left = 0
    right = len(arr) - 1
    mid = 0
    while left <= right:   
        mid = (left + left) // 2
        if arr[mid] < x: 
            left = mid + 1
        elif arr[mid] > x: 
            right = mid - 1
        else: 
            return mid
    return -1
 
s=inp()
c=0
if s.count("R")==1:
    out(1)
else:
    for i in range(3):
        if s[i]=='R':
            c+=1
        elif s[i]=='S' and i!=2:
            c= 0
    out(c)

Solution (Python):
import re
s = input()
arr = re.split(r'S+', s)
print(max([len(e) for e in arr]))

Solution (Python):

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)

Solution (Python):
s=input()
c=0
mc=0
for i in s:
  if i=='R':
    c+=1
    mc=c
  else:
    c=0
print(max(c,mc))

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

Solution (Python):
s = str(input())
ans=cnt=0
for c in s:
    if c=='R':
        cnt+=1
    else:
        cnt = 0
    ans = max(ans,cnt)
print(ans)

Solution (Python):
S = input()

count = S.count('R')

if count == 0 or count == 1 or count == 3:
    print(count)
else:
    if S == 'RSR':
        print(1)
    else:
        print(2)

Solution (Python):
from sys import exit, stdin






S = input()

cnt = 0
for s in S:
    if s == "R":
        cnt += 1
    elif cnt>0 and s=="S":
        break
print(cnt)

Solution (Python):
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)

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

Solution (Python):
import sys
input = sys.stdin.readline

s = list(input())

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

res = max(res,t)
print(res)

Solution (Python):
S = input()
ans = 0
res = 0
for i in range(3):
    if S[i]=='S':
        res = 0
    else:
        res += 1
    ans = max(ans,res)
print(ans)

Solution (Python):
wt = str(input())
if wt == 'SSS':
    print(0)
elif wt == "RRR":
    print(3)
else:
    id = wt.index('R')
    if wt.count('R') == 2 and wt[id] == wt[id+1] == 'R':
        print(2)
    else:
        print(1)

Solution (Python):
s=input()
ans=0
cnt=0
for x in s:
    if x == 'R':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans,cnt)
print(ans)

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

Solution (Python):
S = input()

count = 0
for i in range(3):
  if S[i] == 'R':
    count += 1
  elif i == 1 and S[0] == 'R':
    break
  elif i == 2 and S[1] == 'R':
    break
    
print(count)

Solution (Python):
S = input()

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

Solution (Python):
S = input()
s = list(S)
a = 0
for i in s:
    if i == 'R':
        a += 1

if a != 2:
    print(a)
elif s[1] == 'R':
    print(2)
else:
    print(1)

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
INF = 10**18


if __name__ == "__main__":
    s = input()
    if "R" in s:
        cnt = 1
    else:
        cnt = 0
    for i in range(len(s)-1):
        if s[i] == "R" and s[i+1] == "R":
            cnt+=1
    print(cnt)

Solution (Python):
s = input()

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

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

Solution (Python):
s = str(input())
if s.find('RRR') > -1: ans = 3
elif s.find('RR') > -1: ans = 2
elif s.find('R') > -1: ans = 1
else: ans = 0
print(ans)

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

Solution (Python):
print(len(max(input().split('S'))))

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

Solution (Python):
s=input()

L_3=["RRR"]
L_2=["RRS", "SRR"]
L_0=["SSS"]

if s in L_3:
    print(3)
elif s in L_2:
    print(2)
elif s in L_0:
    print(0)
else:
    print(1)

Solution (Python):
import math
import sys

def dict_sort(ans):
    ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))

def is_prime(n):
    if n==1:
        return 0
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True

def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)

def lcm(a,b):
    return (a*b)//gcd(a,b)

def alphbates():
    return "abcdefghijklmnopqrstuvwxyz"

def binary_search(ls,n,flag):
    low=0
    hi=n-1
    while(low<=hi):
        mid=(low+hi)//2
        if ls[mid]==flag:
            return mid
        elif ls[mid]>flag:
            hi=mid-1
        else:
            low=mid+1
    return -1

def inp():
    ls=list(map(int,input().split()))
    return ls

def mult_inp():
    return map(int,input().split())

s=input()
ls=[]
k=0
for i in range(len(s)):
    if s[i]=='S':
        ls.append(k)
        k=0
    else:
        k+=1
ls.append(k)
print(max(ls))

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

Solution (Python):
S=input()
if S=="RRR":
  print(3)
elif S=="SRR" or S=="RRS":
  print(2)
elif S!="SSS":
  print(1)
else:
  print(0)

Solution (Python):
s = str(input())
if s == "RRR":
    print(3)
elif s == "SRR" or s == "RRS":
    print(2)
elif s == "SSS":
    print(0)
else:
    print(1)

Solution (Python):
import sys
input = sys.stdin.readline

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

main()

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

Solution (Python):
S = input()

if S == 'SSS':
    print(0)
elif S == 'RRR':
    print(3)

elif (S[0] == 'R' and S[1] == 'R') or (S[1] == 'R' and S[2] == 'R'):
   print(2)
else:
    print(1)

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

Solution (Python):
import sys
INF = 1 << 60
MOD = 10**9 + 7 
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
def resolve():
    S = input()
    if "RRR" in S:
        print(3)
    elif "RR" in S:
        print(2)
    elif "R" in S:
        print(1)
    else:
        print(0)
resolve()

Solution (Python):
S = input()

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

Solution (Python):


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

Solution (Python):
import sys
def S(): return sys.stdin.readline().rstrip()

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

Solution (Python):
s = input()
cnt = s.count("R")
if cnt == 2 and s[1] == "S": cnt -= 1
print(cnt)

Solution (Python):
a = list(str(input()))
cnt=0

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


print(cnt)

Solution (Python):
s = input()
if s == "RSR":
	print(1)
else:
	print(s.count("R"))

Solution (Python):



import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """RRS"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """SSS"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """RSR"""
        output = """1"""
        self.assertIO(input, output)


def resolve():
    S = input()
    C = S.count("R")
    if C == 2 and "RR" not in S:
        print("1")
    else:
        print(C)


if __name__ == "__main__":
    
    resolve()

Solution (Python):
s = input()

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

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

Solution (Python):
S = input()

if S == 'SSS':
    ans = 0
elif S == 'SSR':
    ans = 1
elif S == 'SRS':
    ans = 1
elif S == 'SRR':
    ans = 2
elif S == 'RSS':
    ans = 1
elif S == 'RSR':
    ans = 1
elif S == 'RRS':
    ans = 2
elif S == 'RRR':
    ans = 3

print(ans)

Solution (Python):
s=input()
maxsofar = 0

c=0
for i in s:
    if i=="R":
       c+=1
    else:
        c=0

    maxsofar=max(c,maxsofar)

print(maxsofar)

Solution (Python):
S = input()
r = 0

if S == "RRR":
  r = 3
elif S == "RRS" or S == "SRR":
  r = 2
elif S == "RSR" or S.count('R') == 1:
  r = 1
else:
  r = 0

print(r)

Solution (Python):
list = input()


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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


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

Solution (Python):
import re
s = input()
array = re.split(r'S+', s)
print(max([len(e) for e in array]))

Solution (Python):
def solve():
  S = input()
  if S[0]=='R' and S[1]=='R' and S[2]=='R':
    return 3
  if S.count('R')==2:
    if S[1]!='R':
      return 1
    return 2
  if S.count('R')==1:
    return 1
  return 0
print(solve())

Solution (Python):
s = input()
n = 0 
ans = 0
 
for ch in s:
  if ch == 'R':
    n += 1
  else:
    if ans < n:
      ans = n
    n = 0

if ans < n:
  ans = n

print(ans)

Solution (Python):

Si = []
Si = list(str(input()))
i = 0
if Si == ['S','S','S']: i = 0
if Si == ['R','S','S']: i = 1
if Si == ['S','R','S']: i = 1
if Si == ['S','S','R']: i = 1
if Si == ['R','R','S']: i = 2
if Si == ['S','R','R']: i = 2
if Si == ['R','S','R']: i = 1
if Si == ['R','R','R']: i = 3

print(i)

Solution (Python):
s=input()
x=s.count("R")
if x==0 or x==1 or x==3:
    print(x)
else:
    if s.rindex("R")-s.index("R")==1:
        print(2)
    else:
        print(1)

Solution (Python):
s = input()
x = s.count('R')
if(x == 0):
  print(0)
elif(x == 1):
  print(1)
elif(x == 3):
  print(3)
else:
  if(s[0] == 'R'):
    if(s[1] == 'R'):
      print(2)
    else:
      print(1)
  else:
    print(2)

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

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

Solution (Python):
A = input()

cnt = A.count('R')
if cnt == 2:
  ccc = A.find('S')
  if ccc == 1:
    cnt =1

print(cnt)

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):
whether=str(input())
if whether[0]==whether[1]==whether[2]=="R":
    print ("3")
elif whether[0]==whether[1]==whether[2]=="S":
    print ("0")
elif whether[0]==whether[1]=="R" or whether[1]==whether[2]=="R":
    print ("2")
else:
    print ("1")

Solution (Python):
s = input()
if s == "SSS":
    print("0")
elif s == "RSS" and "SRS" and "SSR":
    print("1")
elif s == "SRS":
    print("1")
elif s == "SSR":
    print("1")
elif s == "RSR":
    print("1")
elif s == "RRS":
    print("2")
elif s == "SRR":
    print("2")
elif s == "RRR":
    print("3")
else :
    print(" ")

Solution (Python):
n=input()
n="".join(n)
c,ans=0,0
for i in range(3):
    if n[i]=="R":
        c+=1
        ans=c
    else:
        c=0
        
print(ans)

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

Solution (Python):
a = input()
if a == "RRR":
  print(3)
elif "RR" in a:
  print(2)
elif a == "SSS":
  print(0)
else:
  print(1)

Solution (Python):
S = input()

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

Solution (Python):
s = input()
counter = 1
buffer = 0
if 'R' not in s:
    print(0)
else:
    for i in range(len(s)):
        if s[i] == 'R':
            buffer += 1
        else:
            if buffer > counter:
                counter = buffer
            buffer = 0
        if buffer > counter:
            counter = buffer
    print(counter)

Solution (Python):
x = input()

if x == "RRS" or x == "SRR":
    print(2)

elif x == "RRR":
    print(3)

elif x == "RSS" or x == "SRS" or x == "SSR" or x == "RSR":
    print(1)

else:
    print(0)

Solution (Python):
r = 0
s = input().strip()
for c in s:
    if c == "R":
        r += 1
if "RSR" == s:
    print(1)
else:
    print(r)

Solution (Python):
s = input()

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

Solution (Python):
a = input()
list1 = a.split("S")

if len(list1) == 1:
  print(3)
elif len(list1) == 2:
  if a == "RSR":
    print(1)
  else:
    print(2)
elif len(list1) == 3:
  print(1)
else:
  print(0)

Solution (Python):
S = list(input())




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


if S[1] == 'S':
    if S[0] == S[2]:
        if S[0] == 'R':
            print(1)
        else:
            print(0)
    else:
        print(1)

Solution (Python):
S = input()

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

print(mr)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
import sys
s=str(input())
if s[0]=="R" and s[1]=="R" and s[2]=="R":
  print(3)
  sys.exit()
if s[0]=="R" and s[1]=="R":
  print(2)
  sys.exit()
if s[1]=="R" and s[2]=="R":
  print(2)
  sys.exit()
if s[0]=="R" or s[1]=="R" or s[2]=="R":
  print(1)
  sys.exit()
else:
  print(0)

Solution (Python):
frase= input()
cont=0
if frase[0]=='R' and frase[1]=='S' and frase[2]=='R':
    cont=1
else:
    for x in range(len (frase)):
        if frase[x]=='R':
            cont+=1

print(cont)

Solution (Python):
s = input()
a = s.count("RRR")
b = s.count("RR")
if a == 1:
    print(3)
elif b == 1:
    print(2)
else:
    if s.count("R") > 0:
        print(1)
    else:
        print(0)

Solution (Python):
S = input()
cnt = 0
max_cnt = 0
for i in range(len(S)):
  s = S[i]
  if s == 'R':
    cnt += 1
    if cnt > max_cnt:
    	max_cnt = cnt
  else:
    if cnt > max_cnt:
    	max_cnt = cnt
    cnt = 0
print(max_cnt)

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

Solution (Python):
n=input()

f = 0
cnt = 0
for i in n:
    
    if i == 'R' and f == 1:
            cnt += 1
    elif i == 'R':
        f = 1
        cnt = 1
    elif i == 'S':
        f = 0
print(cnt)

Solution (Python):
mystr = input()
ans = 0
ret = 0
for i in mystr:
    if i == 'R':
        ret += 1
    else:
        ans = max(ans, ret)
        ret = 0
ans = max(ans, ret)
print(ans)

Solution (Python):
S = input()
s = list(S)

count = 0
max_count = 0

for i in s:
    if i == "R":
        count += 1
    else: 
        if max_count <= count:
            max_count = max(max_count,count) 
        count =0
if max_count <= count:
    max_count = count
print(max_count)

Solution (Python):
s = input()

if s.count('R') == 3 :
  print(3)
elif s.count('R') == 1:
  print(1)
elif s.count('R') == 0:
  print(0)
elif s.count('R') == 2:
  res = [i for i in range(len(s)) if s.startswith('R', i)]
  if sum(res) == 2:
    print(1)
  else:
    print(2)