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

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

Solution (Python):
weather = input()
if 'R' * 3 in weather:
  print(3)
elif 'R' * 2 in weather:
  print(2)
elif 'R' in weather:
  print(1)
else:
  print(0)

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

Solution (Python):

import sys
s = input()

num = s.count("R")

if num >= 2:
    if s[1] == "S":
        num = 1

print(num)

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

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

Solution (Python):


import sys
from io import StringIO
import unittest

def resolve():
    a = input()
    
    last = ''
    maxl = 0
    cons =0
    for s in a:
        if s=='R':
            cons = cons +1
            if maxl<cons:
                maxl = cons
        else:
            cons = 0

    
    print("{}".format(maxl))

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)


if __name__ == "__main__":
    resolve()

Solution (Python):
s=list(input())
ans = 0
if s[0]== "S":
  if s[1]=="S":
    if s[2]=="S":
      ans=0
    else:
      ans=1
  else:
    if s[2]=="S":
      ans = 1
    else:
      ans = 2
else:
  if s[1]=="S":
    ans=1
  else:
    if s[2]=="S":
      ans=2
    else:
      ans=3
print(ans)

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

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

Solution (Python):
S = input()

prev = ""
c = 0
ans = 0
for i in S + "S":
    if i == "R":
        c += 1
    if i == "S":
        ans = max(ans, c)
        c = 0
    prev = i
print(ans)

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

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

Solution (Python):
s = input()

ans = 0
pre = 'R'
for i in s:
    if i == 'R' and pre == 'R':
        ans += 1
    elif i == 'R':
        ans = 1
    pre = i

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

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):
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29

DIV = (10**9) + 7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


def main():
    S =sRaw()
    S = S+"."
    nR = 0
    maxNR = 0
    for s in S:
        if s=="R":
            nR+=1
        else:
            maxNR = max(maxNR,nR)
            nR =0
    print (maxNR)

main()

Solution (Python):
A = input()

max = 0
tmp = 0
for i in range(3):
    if A[i] == 'R':
        tmp += 1
    else :
        if max <= tmp:
            max = tmp
        tmp = 0
if max <= tmp:
    max = tmp
print(max)

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

S=list(input().rstrip('\n'))
res = 0
if S[0]=='R':
  res += 1
if S[1]=='S':
  if res == 0 and S[2]=='S':
    print(0)
  else:
    print(1)
else:
  res += 1
  if S[2]=='R':
    res += 1
    print(res)
  else:
    print(res)

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

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

Solution (Python):
S=input()

cnt=0
max_cnt=0
for s in S:
    if(s=="R"):
        cnt+=1
    else:
        cnt=0
    if(max_cnt<cnt):
        max_cnt=cnt

print(max_cnt)

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

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 == "RSR":
    print(1)
else:
    print(S.count("R"))

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

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

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') or (s[1] == 'R' and s[2] == 'R') : 
    print(2)
elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R':
    print(1)
else:
    print(0)

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

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

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

Solution (Python):
s = input()

ans = 0
f = False
for i in range(len(s)):
    if (s[i] == "R"):
        if (f == True):
            ans += 1
        else:
            ans = 1
        f = True
    else:
        f = False

print(ans)

Solution (Python):
S = input()
C = 0
l = []
for s in S:
  if s == "R":
    C += 1
  else:
    l.append(C)
    C = 0
l.append(C)
print(max(l))

Solution (Python):
S = list(str(input()))
max1 = 0
now_max = 0
for i in S:
    if i == "R":
        max1 += 1
        if now_max < max1:
            now_max = max1
    elif i == "S":
        if now_max < max1:
            now_max = max1
        max1 = 0

print(now_max)

Solution (Python):
S = input()


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

Solution (Python):
S=input()
c=0
if S[1]=="S":
  if S[0]=="R" or S[2]=="R":
    c+=1
else:
  c+=1
  if S[0]=="R":
    c+=1
  if S[2]=="R":
    c+=1
print(c)

Solution (Python):


def main(s):
    if s == 'RRR':
        return 3
    if 'RR' in s:
        return 2
    if 'R' in s:
        return 1
    return 0

s = input()
print(main(s))

Solution (Python):
S=input()
ans=0
for i in range(3):
    if S[i]=='R':
        ans+=1
if S[1]=='S':
    if ans==2:
        ans-=1
print(ans)

Solution (Python):
import sys
S = input()
ans = 0

if S == "RRR":
    print(3)
    sys.exit()
elif (S[:2]=="RR" or S[1:] == "RR"):
    print(2)
    sys.exit()
elif (S[0] == "R" or S[1] == "R" or S[2] == "R"):
    print(1)
    sys.exit()
else:
    print(0)

Solution (Python):

s = input()
temp = 0
ans = 0
for i in s:
    if(i == "R"):
        temp += 1
    else:
        if(temp > ans):
            ans = temp
            temp = 0
if(temp > ans):
    ans = temp
print(ans)

Solution (Python):
"""
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""

s = input()
cnt = 0
for i in range(3):
    if s[i]=='R':
        cnt += 1
if (s[1]=='S' and cnt != 0):
    print(1)
    exit()
else:
    print(cnt)

Solution (Python):
s = input()
a=0
if "R" in s:
  a = 1
  if "RR" in s:
    a += 1
    if "RRR" in s:
      a += 1
print(a)

Solution (Python):
S=input()
d=0
c=0
for i in range(len(S)):
  if S[i]=='S':
    c=0
  else:
    c+=1
  if c>d:
    d=c
print(d)

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

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

Solution (Python):
import sys
import math
import bisect

def main():
    s = input()
    max_val = 0
    val = 0
    for i in range(3):
        if s[i] == 'S':
            val = 0
        else:
            val += 1
        max_val = max(max_val, val)
    print(max_val)

if __name__ == "__main__":
    main()

Solution (Python):
s = input()
a = s[0:1]
b = s[1:2]
c = s[2:3]
ans = 0
if a == 'R' and b == 'R' and c == 'R':
  ans = 3
elif (a=='R' and b=='R') or (b=='R' and c=='R'):
  ans = 2
elif a=='R' or b=='R' or c=='R':
  ans = 1
print(ans)

Solution (Python):
s = input()
for i in ['RRR','RR','R']:
    if i in s:
        print(len(i));break
else:
    print(0)

Solution (Python):
s=input()
count=0
if s.count('R')==1:
  print(1)
elif s.count('R')==3:
  print(3)
elif s.count('R')==2:
  if s[1]=="R":
    print(2)
  else:
    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()
ans = 0
tmp = 0

for s in S:
    if s == 'R':
        tmp += 1
        ans = max(ans,tmp)
    elif s == 'S':
        tmp = 0
        ans = max(ans,tmp)
print(ans)

Solution (Python):
a, b, c = input()

if a == 'S' and b == 'S' and c == 'S':
  print(0)
  
elif a == 'R' and b == 'R' and c == 'R':
  print(3)
  
elif b == 'S' and a == 'R':
  print(1)
  
elif b == 'S' and c == 'R':
  print(1)
  
elif a == 'S' and b == 'R' and c == 'S':
  print(1)
  
else:
  print(2)

Solution (Python):
A = input()
if A == 'RRR':
    print(3)
elif A == 'RRS' or A == 'SRR':
    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()
if s == 'RRR': print(3)
elif s == 'RRS': print(2)
elif s == 'SRR': print(2)
elif s == 'SSS': print(0)
else: print(1)

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

Solution (Python):
S = input()

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

Solution (Python):
S = str(input())
count = 0
for i in range(3):
    if S[i] == 'R':
        count += 1
if S == 'RSR':
    count = 1
print(count)

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

Solution (Python):
str = input()
r = 0
con = False
for c in str:
	if c == "S":
		con = False
	elif c == "R" and con == False:
		r = 1
		con = True
	elif c == "R" and con == True:
		r += 1
print(r)

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

Solution (Python):
from itertools import groupby

S = input()
groups = groupby(S)

ans = 0
for k,v in groups:
  if k=="R":
    ans = max(ans, len([e for e in v ]))

print(ans)

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

Solution (Python):
a1 = input()

count = 0
max = 0
for i in a1:
  if i == "R":
    count += 1
    max = count
  elif i == "S":
    count = 0

print(max)

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 'R' not in S:
    print(0)
elif S in ['SSR', 'SRS', 'RSS', 'RSR']:
    print(1)
else:
    print(2)

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

for i in range(len(S)):
  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):
s=input()
c=0
if(s[0]=='R' and s[1]=='R' and s[2]=='R'):
  c=3
elif((s[0]=='R' and s[1]=='R') or (s[1]=='R' and s[2]=='R')):
  c=2
elif (s[0]=='R' and s[2]=='R'):
  c=1
elif(s[0]=='R' or s[1]=='R' or s[2]=='R'):
  c=1
print(c)

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

print(x)

Solution (Python):
s = input().split('S')
s = sorted(s, reverse=True)
print(len(s[0]))

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    s = kwargs["s"]
    if s == "SSS":
        res = 0
    elif s == "RRR":
        res = 3
    elif s == "RRS" or s == "SRR":
        res = 2
    else:
        res = 1
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["s"] = cin[0]

    cout = main(kwargs)
    print(cout)

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

Solution (Python):
S = input()

flg = True

if 'RRR' in S and flg:
    flg = False
    print(3)

elif 'RR' in S and flg:
    flg = False
    print(2)

elif 'R' in S and flg:
    flg = False
    print(1)

else: print(0)

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

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):
from sys import stdin
n = stdin.readline().rstrip()
num = []
tmp = 0
for tenki in n:
    if tenki == 'S':
        num.append(tmp)
        tmp = 0

    else :
        tmp += 1
num.append(tmp)

print(max(num))

Solution (Python):
s=input()
if s.count("R")==0:
	print(0)
elif s.count("RR")==0:
	print(1)
elif s.count("RRR")==0:
	print(2)
elif s.count("RRR")==1:
	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):
n=input()
flag=1
cnt=0
for i in range(3):
    if flag==0:
        if n[i]=="R":
            cnt+=1
        else:
            flag+=1
            break
    else:
        if n[i]=="R":
            cnt+=1
            flag=0
print(cnt)

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

ans=0
ans_list=[]
for s in S:
    if s == 'R':
        ans += 1
    elif s == 'S':
        ans_list.append(ans)
        ans = 0
        
ans_list.append(ans)      
        
print(max(ans_list))

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

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

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

Solution (Python):
S = input()

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

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

Solution (Python):
S=input()
a=1
count=0
for i in range(len(S)):
    if(S[i]=='R') :
        if(count==0):
            a=1
            count=count+1
        elif(S[i-1]=='R'):
            count=count+1

print(count)

Solution (Python):

def main():
    S = input()

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


if __name__ == '__main__':
    main()

Solution (Python):
s = input()

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

if s[2] == "R":
    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):
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 == "SSS":
  print(0)
elif S=="SSR" or S =="SRS" or S =="RSS" or S =="RSR":
  print(1)
elif S=="RRS" or S =="SRR":
  print(2)
elif S=="RRR":
  print(3)

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

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


if 'RR' in s:
    ans=2
else:
    ans=1

if not 'R' in s:
    ans=0

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

Solution (Python):
S=input()
ans=0
temp=0
for x in S:
  if x=="R":
    temp+=1
  else:
    ans=max(ans,temp)
    temp=0
  ans=max(ans,temp)
print(ans)

Solution (Python):
s=input()
s+="S"
c=0
max=0
for i in s:
  if i=="R":
    c+=1
  else:
    if c>max:
      max=c
    c=0
print(max)

Solution (Python):
String = input()
if String[1]=='R':
  print(String.count('R'))
elif String.count('R')>=1:
  print('1')
else:
  print('0')

Solution (Python):
A = str(input())
sum=0
for i in range(3):
    if A[i]=="R":
        if A[i-1]=="R":
            sum+=1
        else:
            sum=1
        
print(sum)

Solution (Python):
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    s = input().rstrip()
    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):
s = input()

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

print(ans)

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

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

s = S.count('R')
if s==2 and S[0] == 'R' and S[2] == 'R':
    s -= 1

print(s)

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

print(max)

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
si = sys.stdin.readline


def main():
    s = si()[:-1]
    m, cnt = 0, 0
    for e in s:
        if e == 'R':
            cnt += 1
        elif e == 'S':
            cnt = 0
        m = max(m, cnt)
    print(m)


if __name__ == '__main__':
    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()
ans = 0
tmp = 0
for c in s:
  if c == 'S':
    tmp = 0
  else:
    tmp += 1
  if tmp > ans:
    ans = tmp
print(ans)

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

Solution (Python):



def main():
    s = list(input())
    c = 0
    p = "S"
    r = 0
    for e in s:
        if e == "R":
            c += 1
        if c > r:
            r = c
        if e == "S":
            c = 0
    print(r)


if __name__ == "__main__":
    main()

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

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

Solution (Python):





"""
"""

from collections import defaultdict
import bisect

import sys
input = sys.stdin.readline

def solve(s):
    ans = 0
    tmp = 0
    for ss in s:
        if ss == 'R':
            tmp += 1
            ans = max(ans,tmp)
        else:
            tmp = 0
    print(ans)

            

def main():
    s = input().rstrip()
    solve(s)


if __name__ == "__main__":
    main()

Solution (Python):
s = input()

def ans(a):
    if s == 'RSR':
        return 1
    else:
        return (s[0] == 'R') + (s[1] == 'R') + (s[2] == 'R')

print(ans(s))

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

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

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

elif s.count("R") ==1 or s == "RSR":
  print("1")

else:
  print("2")

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

cnt = 0
for i in range(3):
    if S[i] == "R":
        cnt += 1
    
    if cnt > 0 and S[i] == "S":
        break

print(cnt)

Solution (Python):

import sys


S =input().strip()
ans =0
if S =="RRR":
    ans =3
elif S[:2]=="RR" or S[1:]=="RR":
    ans =2
elif S[0] =="R" or S[1] =="R" or S[2] =="R":
    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):
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=="SSS":
    print(0)
elif S=="SSR" or S=="RSS" or S=="SRS" or S=="RSR":
    print(1)
else:
    print(2)

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

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

if 'RRR' in s:
    print(3)
    exit()
if 'RR' in s:
    print(2)
    exit()
if 'R' in s:
    print(1)
    exit()

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

Solution (Python):
s = str(input())
if s == 'RRR':
    ans = 3
elif s[:2] == 'RR' or s[1:] == 'RR':
    ans = 2
elif s.count('R') == 0:
    ans = 0
else:
    ans = 1
print(ans)

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

Solution (Python):
import sys












stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    n = str(stdin.readline().rstrip())
    
    
    
    
    
    
    ans = 0
    for i in range(3):
        if n[i] == "R":
            if i != 2 and n[i+1] == "R":
                if i == 0 and n[i+2] == "R":
                    ans = 3
                    break
                else:
                    ans = 2
                    break
            else:
                ans = 1
        else:
            pass
    print(ans)

if __name__ == '__main__':
    solve()

Solution (Python):
n=input()
if n=="RRR":
    print("3")
elif n=="SSS":
    print("0")
elif n=="SRS":
    print("1")
elif n[1]=="S":
    print("1")
else:
    print("2")

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

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

Solution (Python):
raw = input()
weather = list(raw)
c = weather.count("R")

if c != 2:
  print(c)
elif raw == "RRS" or raw == "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=='RSS' or S=='SRS' or S=='SSR' or S=='RSR':
  print(1)
else:
   print(0)

Solution (Python):
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    return

if __name__=='__main__':
    s = S()
    if s=="RRR":
        print(3)
    elif s=="RRS" or s=="SRR":
        print(2)
    elif s=="SSS":
        print(0)
    else:
        print(1)
    solve()

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

Solution (Python):
s = input()
for i in range(5):
    if "R"*i not in s:
        print(i-1)
        break

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 "R" not in S:print(0)
elif S.count("R")==1:
    print(1)
elif S.count("R")==3:print(3)
else:
    if S=="RRS" or S=="SRR":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):
S = input()

cnt = 0
cnt2 = []
flag = False
for i in range(3) :
    if S[i] == 'R' :
        if flag == True :
            cnt += 1
        else :
            cnt = 1
            flag = True
    else :
        cnt = 0
        flag = False
    cnt2.append(cnt)

print(max(cnt2))

Solution (Python):
X = input()
ans = 0
flag = True
for x in X:
    if flag:
        if x == "R":
            ans += 1
            flag = False
    else:
        
        if x == "R":
            ans += 1
        else:
            break
print(ans)