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):
s=input()
ans=0
m=0
for i in range(3):
    if s[i]=="R":
        m+=1
    else:
        ans=max(m,ans)
        m=0
ans=max(m,ans)
print(ans)

Solution (Python):

from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


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)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    s = S()
    if s == ['R', 'S', 'R']:
        print(1)
    else:
        print(s.count('R'))
    return


if __name__ == "__main__":
    solve()

Solution (Python):
s = input()

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

Solution (Python):
N = input()
cons = 0
flag = 0
for i in range(len(N)):
    if (N[i]=='S'):
        flag = 0
        if cons>=1:
            print(cons)
            exit(0)
    else:
        flag = 1
        cons += 1
print(cons)

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

Solution (Python):
s = input()

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

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()
ans1 = 0
ans = 0
for i in range(3):
    if s[i]=="R":
        ans1 += 1
    else:
        ans = ans1
        ans1 = 0
if not s=="RSS":
    print(max(ans,ans1))
else:
    print("1")

Solution (Python):
def main():
    tenki = input()
    leng = len(tenki)

    count = 0
    lst = []
    for i in range(leng):
        if tenki[i] == "R":
            count += 1
        else:
            lst.append(count)
            count = 0
    lst.append(count)
    count = 0
    print(max(lst))


if __name__ == '__main__':
    main()

Solution (Python):
import re

S = input()

rrr = S.count("RRR")
rr = S.count("RR")
r = S.count("R")

if rrr == 1:
    print(3)
elif rr == 1:
    print(2)
elif r == 1 or r == 2:
    print(1)
else:
    print(0)

Solution (Python):
S=input()

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

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):
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")
elif a[2] == "R":
    print("1")
else:
    print("0")

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

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

if __name__ == '__main__':
    main()

Solution (Python):
renzoku = 0

S = input()

for i, weather in enumerate(S):
    if not weather == "R":
        continue
    if renzoku == 0: renzoku += 1
    try:
        if S[i+1] == "R":
            renzoku += 1
    except:
        continue

print(renzoku)

Solution (Python):
a = list(input())
total = 0
if a[0] == "R":
    total += 1
    if a[1] == "R":
        total += 1
        if a[2] == "R":
            total += 1
elif a[1] == "R":
    total += 1
    if a[2] == "R":
        total += 1
elif a[2] == "R":
    total += 1
print(total)

Solution (Python):
S = str(input())
answer = list()
answer.append(['SSS'])
answer.append(['SRS', 'RSR', 'SSR', 'RSS'])
answer.append(['RRS', 'SRR'])
answer.append(['RRR'])
for i in range(len(answer)):
    if S in answer[i]:
        print(i)

Solution (Python):
s = input()
ans = 0
for i in range(3):
  if s[i]=="R":
    temp = 1
    count = i
    flg=False
    while count<3 and s[count]=="R":
      flg=True
      temp+=1
      count+=1
    if flg:
      temp-=1
    ans = max(ans, temp)
print(ans)

Solution (Python):
a = input()

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

Solution (Python):
x=input()
a=x.find('R')
b=x.find('RR')
c=x.find('RRR')
if c>=0:
  print(3)
elif b>=0:
  print(2)
elif a>=0:
  print(1)
else:
  print(0)

Solution (Python):
_weather = list(input())
if _weather[0] == "R":
  if _weather[1] == "R":
    if _weather[2] == "R":
      print(3)
    else:
      print(2)
  else:
    print(1)
else:
  if _weather[1] == "R":
    if _weather[2] == "R":
      print(2)
    else:
      print(1)
  else:
    if _weather[2] == "R":
      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().strip("¥n")

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 == 'RSR':
    print(1)
elif s == 'SRS':
    print(1)
else:
    ans = s.count('R')
    print(ans)

Solution (Python):

 
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)

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

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

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

Solution (Python):
s = input()

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

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

Solution (Python):
s = input()

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')







def solve():
    S = input()
    L = S.split('S')
    ans = 0
    for l in L:
        ans = max(ans, len(l))
    print(ans)



if __name__ == '__main__':
    solve()

Solution (Python):
s = input()

ans = 0

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

print(ans)

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

Solution (Python):

T = input()

mae=""
ans=""
for i in range(3):
    if i==0:
        if T[i]=="R":
            mae=T[i]
            ans+=T[i]
    elif i>0:
        if mae=="R" and T[i]=="R":
            ans+=T[i]
        elif mae!="R" and T[i]=="R":
            ans=T[i]
        mae=T[i]
print(len(ans))

Solution (Python):
s = input()

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

if s=='RRS':print(2)
if s=='SSR':print(1)

if s=='RSR':print(1)
if s=='SRS':print(1)

if s=='SRR':print(2)
if s=='RSS':print(1)

Solution (Python):
def resolve():
    s = input()
    out = 0
    l = []
    for i in range(3):
        if s[i] == 'R':
            out += 1
        elif s[i] == 'S':
            l.append(out)
            out = 0
    l.append(out)
    print(max(l))
resolve()

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

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

Solution (Python):
import math

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


def b():
    pass



def c():
    pass



def d():
    pass


a()

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

Solution (Python):

import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 


from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[j - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] =  j
    return pi

def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

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

def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else '0' * (length - len(y)) + y

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

Solution (Python):
S = input()
cnt = 0
cnt_max = 0

for i in S:
    if i == 'R':
        cnt += 1
        cnt_max = cnt
    else:
        
        cnt = 0
print(cnt_max)

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

r = s.count("R")

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

Solution (Python):
s = input()
c = s.count("R")
if c==3:
    print(3)
elif c==2:
    if s[0]==s[1]=="R" or s[1]==s[2]=="R":
        print(2)
    else:
        print(1)
elif c==1:
    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):
from re import search

s = input()
m = search(r'R+', s)

print(len(m.group()) if m is not None else 0)

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

Solution (Python):
s = input()
maxCount = 0
count = 0

for i in s:
  if(i == 'R'):
    count += 1
  else:
    maxCount = max(count, maxCount)
    count = 0
    
print(max(count, maxCount))

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 = list(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)
else:
    if s[2] == "R":
        print(1)
    else:
        print(0)

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

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

Solution (Python):
string = input()

count = 0
cont = True

for s in string:
    if s == 'R':
        if cont:
            count += 1
        else:
            count = 1
        cont = True
    else:
        cont = False

print(count)

Solution (Python):


S = input()

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

Solution (Python):
S = input()

if S == 'RRR':
    print(3)
elif S == 'RSR' or S=='SSR' or S=='RSS' or S=='SRS':
    print(1)
elif S == 'RRS' or S=='SRR':
    print(2)
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):
import re
s = input()
print(max(map(len, re.split('S', s))))

Solution (Python):


import numpy as np

weather = input()
w_temp = 0
w_sum = 0

for i in range(len(weather)):
    if weather[i] == "R":
        w_temp += 1
    else:
        if w_sum < w_temp:
            w_sum = w_temp
        w_temp = 0

if w_sum < w_temp:
    w_sum = w_temp

print(str(w_sum))

Solution (Python):
s=input()
if s[0]=="R" and s[1]=="R" and s[2]=="R":
    print(3)
elif s[0]=="R" and s[1]=="R":
    print(2)
elif s[1]=="R" and s[2]=="R":
    print(2)
elif s=="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 == 'RSS' or S == 'SSR' or S == 'SRS' or S == 'RSR':
  print(1)
else:
  print(0)

Solution (Python):
from itertools import groupby

ans = 0
for k, it in groupby(input()):
    if k == "R":
        ans = max(ans, len(list(it)))
print(ans)

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 = str(input())


if s == "RRR":
    print(3)
elif s == "SSS":
    print(0)
elif s == "RRS" or s == "SRR":
    print(2)
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 = list(input())

if 'S' not in s:
  print(3)

elif 'R' not in s:
  print(0)

elif s.count('S') == 2:
  print(1)

else:
  if s.index('S') == 1:
    print(1)
  else:
    print(2)

Solution (Python):
def main():
    s = input()
    r = s.count('R')
    if r in [0,1,3]:
        print(r)
    else:
        if s[0] == s[1] or s[1] == s[2]:
            print(2)
        else:
            print(1)
            
main()

Solution (Python):
s=input()
c=0
a=[]
for i in s:
  if i=='R':
    c+=1
    
  else:
    a.append(c)
    c=0
a.append(c)    
print(max(a))

Solution (Python):

S = str(input())
cnt = 0
cnt1 = 0
for i in range(len(S)):
    if S[i] == "R":
        cnt += 1
    if S[i] == "S":
        cnt1 = max(cnt,cnt1)
        cnt = 0
if cnt > cnt1:
    print(cnt)
else:
    print(cnt1)

Solution (Python):
a=input()
b=a.split('S')
ans=0
for i in b:
    if len(i)>ans:
        ans=len(i)
print(ans)

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
S = input()

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

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

Solution (Python):
A = input()
if 'R' not in A:
    print(0)
elif 'S' not in A:
    print(3)
elif 'RR' in A:
    print(2)
elif 'SS' or 'R' in A:
    print(1)

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

Solution (Python):


import sys

sys.setrecursionlimit(10 ** 6)


S = input()

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

print(res)

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

def main():
    S = input().rstrip()
    ans = 0
    cnt = 0
    isR = False
    for s in S:
        if s == 'R':
            if isR:
                cnt += 1
            else:
                cnt = 1
                isR = True
        else:
            isR = False
            ans = max(ans, cnt)
    ans = max(cnt, ans)
    print(ans)

if __name__ == "__main__":
    main()

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

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

Solution (Python):
a = list(input())
count=0
if a.count('R')==3:
  print(3)
elif a.count('R')==1:
  print(1)
elif a.count('R')==0:
  print(0)
else:
  flag = True
  for i in range(1,3):
    if a[i]=='R':
      if a[i-1]=='R':
        print(2)
        flag =False
        break
  if flag==True:
    print(1)

Solution (Python):
W = input()
ans = 0
for i in W:
  if i == "R":
    ans += 1
  if (ans>0) and (i=="S"):
    break
print(ans)

Solution (Python):
S = input()
ans = 0
tmp = 0
preR = 0
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)
elif S == 'RRR':
    print(3)

Solution (Python):
S = input()

cnt = S.count('R')
if cnt == 1:
    print(cnt)
elif cnt == 0:
    print(cnt)
elif cnt == 3:
    print(cnt)
else:
    if S[1] == "S":
        print(1)
    else:
        print(cnt)

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

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

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

wea = list(input())
if wea[0] == "R":
  if wea[1] == "R":
    if wea[2] == "R":
      print(3)
    elif wea[2] == "S":
      print(2)
  elif wea[1] == "S":
    print(1)
elif wea[0] == "S":
  if wea[1] == "R":
    if wea[2] == "R":
      print(2)
    elif wea[2] == "S":
      print(1)
  elif wea[1] == "S":
    if wea[2] == "R":
      print(1)
    elif wea[2] == "S":
      print(0)

Solution (Python):


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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
S=input()
if S=="RSR":
    print(1)
else:
    
    print(len(S.replace("S","")))

Solution (Python):
def main():
    s = input()
    ans = 0
    if s[0] == 'R' and s[0] == s[1] and s[1] == s[2]:
        ans = 3
    elif s[0] == 'R' and s[0] == s[1]:
        ans = 2
    elif s[1] == 'R' and s[1] == s[2]:
        ans = 2
    elif 'R' in s:
        ans = 1
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import re

tex = str(input())

if tex == 'RRR':
  print(3)
elif re.search('RR',tex):
  print(2)
elif re.search('R', tex):
  print(1)
else:
  print(0)

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

Solution (Python):
S = input()

if S[2] == 'R':
    ans = 1
else:
    ans = 0
    

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

print(ans)

Solution (Python):
n = input()

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

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

Solution (Python):
s =input()

ans =0
if s.count("R") == 2 :
  if  s.count("RR") == 1:
    ans = 2
  else:
    ans = 1
else:
  ans = s.count("R")
print(ans)

Solution (Python):




s = input()


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

if cnt == 3:
    ans = 3
elif cnt == 2:
    if s[1] == 'S':
        ans = 1
    else:
        ans = 2
elif cnt == 1:
    ans = 1
else:
    ans = 0


print(ans)

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

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

Solution (Python):
S= input()

if S.count('RRR') == 1:
    print(3)
elif S.count('RR') == 1:
    print(2)
elif S.count('RSR') == 1 or S.count('RSS') == 1 or S.count('SRS') == 1 or S.count('SSR') == 1:
    print(1)
else:
    print(0)

Solution (Python):
line = input().rstrip()
count = 0


if 'R' in line:
  if line == 'RRR':
    print(3)
  elif line == 'RSR':
  	print(1)
  else:
    for i in range(3):
      if line[i] == 'R':
        count += 1
    print(count)
else:
  print(0)

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

if S[0] == 'R':
    cnt = 1
    if S[1] == 'R':
        cnt = 2    
        if S[2] == 'R':
            cnt = 3
else:
    if S[1] == 'R':
        cnt = 1
        if S[2] == 'R':
            cnt = 2
    elif S[2] == 'R':
        cnt = 1

print(cnt)

Solution (Python):
N = input()

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

Solution (Python):
s=input()
ans=0
for i in range(1,4):
	if s.count("R"*i):
		ans=max(ans,i)
print(ans)

Solution (Python):
W = input()
if W == 'RRR':
    print(3)
elif W == 'SSS':
    print(0)
elif any([W == 'RRS',  W == 'SRR']):
    print(2)
else:
    print(1)

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

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

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

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

ma = max(count, ma)
print(ma)

Solution (Python):
s=input()
if s=="RSR":
    print(1)
    exit()
elif s!="RSR":
    cnt=0
    for i in range(3):
        if s[i]=="R":
            cnt+=1
    print(cnt)

Solution (Python):
import itertools

S = input()
print(max((len(list(g)) for k, g in itertools.groupby(S) if k == 'R'), default=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)
elif s.count('RR') == 1:
    print(2)
elif s.count('R') >= 1:
    print(1)
else:
    print(0)

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')

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


if __name__ == '__main__':
    main()

Solution (Python):
l=list(input())
if l[0]=='R':
  if l[1]=='R':
    if l[2]=='R':
      print(3)
    else:
      print(2)
  else:
      print(1)
else:
  if l[1]=='R':
    if l[2]=='R':
      print(2)
    else:
      print(1)
  else:
    if l[2]=='R':
      print(1)
    else:
      print(0)

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

Solution (Python):
S = input()

r = S.count("R")

if S == "RSR":
    r -= 1

print(r)

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


if __name__ == "__main__":
    main()

Solution (Python):
S = input()
cnt = 0
current = 0
for idx in range(len(S)):
  if S[idx] == "R":
    current = current + 1
  else:
    current = 0
  
  if cnt < current:
    cnt = current
print(cnt)

Solution (Python):
S = input()

if S == "RRR":
  print(3)
elif S in ["RSS", "SRS", "SSR", "RSR"]:
  print(1)
elif S in ["RRS", "SRR"]:
  print(2)
else:
  print(0)

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

Solution (Python):
S = input()

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

Solution (Python):
count = 0
s = str(input())
if s[0] == 'R':
    count += 1
    if s[1] == 'R':
        count +=1
        if s[2] == 'R':
            count += 1
else:
    if s[1] == 'R':
        count += 1
        if s[2] == 'R':
            count +=1
    else:
        if s[2] == 'R':
            count +=1
print(count)

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

Solution (Python):
data = input()

continuous = 0
is_before_rain = False
for i in range(3):
  if data[i] == 'R' and is_before_rain:
    continuous += 1
  if data[i] == 'R':
    is_before_rain = True
  else:
    is_before_rain = False

print( continuous + int('R' in data) )

Solution (Python):
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
    if S[2]=="R":
        A+=1

    print(A)

Solution (Python):


S = list(input())
cnt = [0]

for i in range(3):
    if S[i] == "R":
        a = cnt[i]+1
        cnt.append(a)
    else:
        a = 0
        cnt.append(a)
        
        
print(max(cnt))

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

Solution (Python):
a = input()
o = 0
if 'R' in a[:]:
  o += 1
for i in range(2):
  if a[i] == 'R' and a[i+1] == 'R':
    o += 1
print(o)

Solution (Python):
s=input()
c=0
f=0
if s.count('R')==3:
  print(3)
  f=1
if s.count('R')<=1 and f==0:
  print(s.count('R'))
  f=1

if s[0]=='R' and s[1]=='R' and f==0:
  print(2)
  f=1
if s[1]=='R' and s[2]=='R' and f==0:
  print(2)
  f=1
if f==0:
  print(1)

Solution (Python):
s = input()
res = 0
prev = ''
for c in s:
  if c == 'R':
    if prev == 'R':
      res += 1
    else:
      res = 1
  prev = c
print(res)