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):
i = 0
j = 0
k = 0

w = ""
for s in input():
    j += 1

    if s == "S":
        k += 1

    if s == "S" and i > 0 and j == 2 and w != "R":
        i -= 1

    if s == "R" and (w == "R" or w == ""):
        i += 1
    elif s == "R" and w != s:
        i += 1    
    
    if w == "S":
        i = 1
    
    w = s

if k == 3:
    i = 0

print(i)

Solution (Python):
x = str(input())
if x == 'SSS':
  print(0)
elif x == 'SSR':
  print(1)
elif x == 'SRS':
  print(1)
elif x == 'RSR':
  print(1)
elif x == 'RSS':
  print(1)
elif x == 'SRR':
  print(2)
elif x == 'RRS':
  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):
A = input()
count = 0
for i in range(3):
  if A[i] == "R":
    count = 1
for i in range(2):
  if A[i]+A[i+1] == "RR":
    count = 2
if A == "RRR":
  count = 3
    
print(count)

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

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

s = readline().rstrip().decode('utf-8')

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

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

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

count = 0



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

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

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

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

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

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

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

if __name__=="__main__":
    main()

Solution (Python):
s = input()
S = list(s)
re = 0
a = 0
for i in range(3):
    if S[i] == 'R':
        a += 1
if a > 0:
    if a == 2:
        if S[0] == S[1] or S[1] == S[2]:
            re = 2
        else:
            re = 1
    elif S[0] == S[1] and S[1] == S[2] and a == 3:
        re = 3
    else:
        re = 1
else:
    re = 0
print(re)

Solution (Python):
weather = input()

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

Solution (Python):
def main():
    S = input()

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


if __name__ == '__main__':
    main()

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

Solution (Python):
weather = input()
rainyDay = weather.count('R')
if rainyDay < 2:
    print(rainyDay)
else:
    if weather[1] == 'R':
        print(rainyDay)
    else:
        print(1)

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

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

Solution (Python):
s=input()
a=s.count("R")
be=""
count=0

for i in s:
  if be==i and be=="R":
    count+=1
    
  be=i
  
if s.count("R")>=1 and count==0:
  print(1)
  
else:
  print(count+1 if count>=1 else count)

Solution (Python):
S= input()
count = 0
if not 'R' in S:
    print(0)
elif S[1] != 'R':
    print(1)
else:
    for i in S:
        if i == 'R':
            count += 1
    print(count)

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):
import sys


def read_input():
    return sys.stdin.readline().strip().split(' ')


def task(s):
    rainy_til = []
    l = len(s)
    i = 0
    while i < l:
        if s[i] == 'R':
            last_rainy = rainy_til[i - 1] if i > 0 else 0
            rainy_til.append(last_rainy + 1)
        else:
            rainy_til.append(0)
        i += 1
    return max(rainy_til)


def main():
    [s] = read_input()
    result = task(s)
    print(result)


main()

Solution (Python):
n = list(input())
if n[1] == 'R':
    print(n.count('R'))
elif n.count('R') == 2 or n.count('R') == 1:
    print(1)
else:
    print(0)

Solution (Python):
str = input()
i = 0
if 'R' in str:
        i += 1
        if(str.count('R')>= 2):
                for j in range(len(str)-1):
                        if str[j] == str[j+1]:
                                i += 1
print(i)

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

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

Solution (Python):
S = input()
list_s = list(S)
count = 0
x = []
for i in range(3):
    if list_s[i] == 'R':
        count +=1
    elif list_s[i] == 'S':
        x.append(count)
        count = 0
x.append(count)
print(max(x))

Solution (Python):
s = input()

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

Solution (Python):
def b(line):
	cnt = 0
	for i in range(len(line)):
		if cnt < 1 and line[i] == 'R':
			cnt += 1
			continue
		if cnt >= 1 and line[i] == line[i-1] and line[i] == 'R':
			cnt += 1
			continue
	return cnt

print(b(input()))

Solution (Python):
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    S = input().strip().split("S")
    print(max(len(s) for s in S))


if __name__ == "__main__":
    main()

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

Solution (Python):
weather = input()
rainyDay = weather.count('R')
if rainyDay < 2:
    print(rainyDay)
else:
    if weather[1] == 'R':
        print(rainyDay)
    else:
        print(1)

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

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

if re.search(r'(R)\1{2,}', RS):
  print(3)
elif re.search(r'(R)\1{1,}', RS):
  print(2)
elif RS == "SSS":
  print(0)
else:
  print(1)

Solution (Python):
X = input()

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

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

import collections
from functools import lru_cache


def read():
    return input().strip()


def readInt():
    return int(input().strip())


def readList():
    return list(map(int, input().strip().split()))


def solve(s):
    i = 0
    N = len(s)
    ans = 0

    while i < N:
        while i < N and s[i] == "S":
            i += 1

        if i >= N:
            break

        j = i+1

        while j < N and s[j] == "R":
            j += 1

        ans = max(ans, j-i)
        i = j

    return ans


s = read()
print(solve(s))

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

Solution (Python):
s = input()

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

Solution (Python):
N=str(input())
ia =0
z =0

for i in range(len(N)):
    if N[i]=="R":
        ia+=1
        if ia>z:
            z=ia
    else :
        if ia>z:
            z=ia
        ia=0

print(z)

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

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

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

cnt = 0

for i in range(3):
    if n[i] == 'R':
        cnt += 1
if cnt == 2 and n[1] == 'S':
    print(1)
    exit(0)
print(cnt)

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

Solution (Python):
s = list(input())
l = len(s)
rain =int()
maxrain =int()
for x in range(l):
  if s[x]=="R":
    rain=rain+1
    maxrain=rain
  else:
    rain=0
    maxrain=maxrain
print(maxrain)

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

Solution (Python):
s = input()
stack = []
ans = 0
for i in range(3):
    if s[i] == "R":
        stack.append("R")
        ans = max(ans, len(stack))
    else:
        stack = []

print(ans)

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

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

Solution (Python):
a = input()
b = 0
c = 'R'
d = []
for i in a:
  if i == 'R' and c == 'R':
    b = b + 1
    c = 'R'
  elif i == 'R':
    c = 'R'
    b = 1
  else:
    c = 'S'
    b = 0
  d.append(b)
e = sorted(d, reverse=True)
print(e[0])

Solution (Python):

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

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

print(ans)

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

Solution (Python):


a = input()

if a == "RRR":
    print("3")

elif a == "RRS" :
    print("2")

elif a == "SRR" :
    print("2")

elif a == "SRS" :
    print("1")

elif a == "RSS" :
    print("1")

elif a == "SSR" :
    print("1")

elif a == "RSR" :
    print("1")

elif a == "SSS" :
    print("0")

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

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

Solution (Python):
sd = input()
ok = 0
if sd[0] == 'R':
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok = 1
            print(3)
        else:
            ok = 1
            print(2)
    else:
        ok = 1
        print(1)
else:
    if sd[1] == 'R':
        if sd[2] == 'R':
            ok =1 
            print(2)
        else:
            ok = 1
            print(1)
    else:
        if sd[2] == 'R':
            print(1)
            ok = 1
if ok == 0:
    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):
def solve(s):

  res=0

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

    elif s[i]=="S" and res>0:
      return res
  return res
  
s=input()
print(solve(s))

Solution (Python):
w = input()

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

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

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

Solution (Python):
x, y ,z = input()
if  x == "S" and y == "S" and z == "S":
    print(0)
elif x =="S" and y=="R" and z=="R":
    print(2)
elif x=="R" and y=="R" and z=="S":
    print(2)
elif x=="R" and y=="R" and z=="R":
    print(3)
else:
    print(1)

Solution (Python):
s = input()
r = s.count("RRR")
n = s.count("RR")

if r == 1:
    print(3)
elif n == 1:
    print(2)
else:
    if s.count("R")>0:
        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):
elem = input()
single = elem.count("R")
double = elem.count("RR")
triple = elem.count("RRR")
if triple == 1:
    print(3)
elif double == 1:
    print(2)
else:
    if single > 0:
        print(1)
    else:
        print(0)

Solution (Python):
import sys,bisect,string,math,time,functools,random,fractions
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
rep=range;R=range
def Golf():n,*t=map(int,open(0).read().split())
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def RA():return map(int,open(0).read().split())
def RLI(n=8,a=1,b=10):return [random.randint(a,b)for i in range(n)]
def RI(a=1,b=10):return random.randint(a,b)
def Rtest(T):
    case,err=0,0
    for i in range(T):
        inp=INP()
        a1,ls=naive(*inp)
        a2=solve(*inp)
        if a1!=a2:
            print((a1,a2),inp)
            err+=1
        case+=1
    print('Tested',case,'case with',err,'errors')
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            org_inp.append(inp)
        else:
            inp=ls[i]
        if len(inp)==2:
            a,b=inp;c=1
        else:
            a,b,c=inp
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'
    
    mp=[boundary]*(w+2);found={}
    for i in R(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def accum(ls):
    rt=[0]
    for i in ls:rt+=[rt[-1]+i]
    return rt
def bit_combination(n,base=2):
    rt=[]
    for tb in R(base**n):s=[tb//(base**bt)%base for bt in R(n)];rt+=[s]
    return rt
def gcd(x,y):
    if y==0:return x
    if x%y==0:return y
    while x%y!=0:x,y=y,x%y
    return y
def YN(x):print(['NO','YES'][x])
def Yn(x):print(['No','Yes'][x])
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

mo=10**9+7
inf=float('inf')
FourNb=[(-1,0),(1,0),(0,1),(0,-1)];EightNb=[(-1,0),(1,0),(0,1),(0,-1),(1,1),(-1,-1),(1,-1),(-1,1)];compas=dict(zip('WENS',FourNb));cursol=dict(zip('LRUD',FourNb))
l_alp=string.ascii_lowercase

read=sys.stdin.buffer.read;readline=sys.stdin.buffer.readline;input=lambda:sys.stdin.readline().rstrip()


show_flg=False
show_flg=True

ans=0

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

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

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

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



def count(list_1):
    count_2 = 0
    count_1 = 0
    for a in range(len(list_1)):
        if list_1[a] == 'R':
            count_1 += 1
        else:
            count_1 = 0
        if count_2 < count_1:
            count_2 = count_1
            
    return count_2

print(count(N))

Solution (Python):
input_n = input()
n = str(input_n)

tmp = 0
result = 0

list_n = list(n)

for i in range(3):
    if list_n[i] == 'R':
        tmp += 1
    if list_n[i] == 'S':
        if tmp > result:
            result = tmp
            tmp = 0

if tmp > result:
    result = tmp
    tmp = 0

print(str(result))

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]





S = input()

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

Solution (Python):
def main():
    import sys
    S=sys.stdin.readline().strip()
    if S=='RSR':
        print(1)
    else:
        print(S.count('R'))

main()

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

if(s.count("RRR") == 1):
    print(3)
elif(s.count("RR") == 1):
    print(2)
elif(s.count("R") == 1 or s.count("RSR") == 1):
    print(1)
elif(s.count("SSS") == 1):
    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 == "SRR" or s == "RRS":
    print(2)
elif s == "RRR":
    print(3)

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

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	
	
	s = input()
	r=0
	rm=0
	for c in s:
		if c == 'R':
			r+=1
			rm = max(r,rm)
		else:
			r=0
	return rm
	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
s = input().upper()
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()
s=[input() for i in range(0,0)]

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

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

print(x)

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

Solution (Python):
S = 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=input()
if s.count('R')==3:
    print(3)
if s.count('R')==2:
    if s=='RSR':
        print(1)
    else:
        print(2)
if s.count('R')==1:
    print(1)
if s.count('R')==0:
    print(0)

Solution (Python):

"""
Created on Sat Aug 15 21:02:30 2020

@author: naoki
"""

S = input()
sq = [S[0],S[1],S[2]]

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

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):
w=input()
cw={'RRR':3, 'RRS':2, 'RSR':1, 'RSS':1,
    'SRS':1, 'SSR':1, 'SRR':2, 'SSS':0 }
print(cw[w])

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

Solution (Python):
S = str(input())
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):
a=str(input())
if a == 'RRR':
  print(3)
elif a == 'RRS'or a=='SRR':
  print(2)

elif a == 'RSR' or a== 'SSR' or a=='SRS' or a=='RSS':
  print(1)
else:
  print(0)

Solution (Python):
s = input()
r = s.count("RRR")
n = s.count("RR")

if r == 1:
    print(3)
elif n == 1:
    print(2)
else:
    if s.count("R")>0:
        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] == 'S'):
        print(1)
    else:
        print(2)

Solution (Python):



temp = input()

S = list(temp)

cnt=0
max_cnt=0
tmp_s = ""
flag=0

cnt = S.count('R')
if cnt == 2:
    if S[1] == 'S':
        cnt=1

print(cnt)

Solution (Python):
s = input().upper()
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()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      count+=1
  print(count)

Solution (Python):
S=list(input().split("S"))
print(max(len(s) for s in S))

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

for w in s:
    if w == 'R':
        ans += 1
    else:
        if ans > x:
            x = ans
        ans = 0

print(max(x, ans))

Solution (Python):
S = input().strip()
c = 0
res = 0
for s in S:
    if s == 'R':
        c += 1
        res= max(res, c)
    else:
        c = 0

print(res)

Solution (Python):
s = input()
c = 0
ans = 0
for cc in s:
    if cc == "R":
        c += 1
if c <= 1:
    print(c)
elif s[1] == "S":
    print(1)
else:
    print(c)

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

Solution (Python):
s = input()

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

Solution (Python):
S = input()

if S == "SSR" or S =="SRS" or S =="RSS" or S=="RSR":
    ans = 1
elif S =="RRR":
    ans = 3
elif S=="SSS":
    ans = 0
else:
    ans = 2

print(ans)

Solution (Python):
s = input()
r = s.count("RRR")
n = s.count("RR")

if r == 1:
    print(3)
elif n == 1:
    print(2)
else:
    if s.count("R")>0:
        print(1)
    else:
        print(0)

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


if __name__ == "__main__":
    solve()

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

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

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

print(ans)

Solution (Python):
S = input()
table = {
    'S':'0',
    'R':'1'
}
b_S = ''.join(table.get(c, c) for c in S)

r_1 = 0
r_2 = 0
result = 0
for s in b_S:

    if int(s) == 1 and r_1 == 1:
        r_2 = 1
    else:
        r_2 = 0

    if int(s) == 1:
        r_1 = 1
    else:
        r_1 = 0

    if r_2 == 1:
        result = result + 1


if '1' in b_S:
    result = result + 1
print(result)

Solution (Python):
s = input()
ans = 1 if 1 <= s.count('R') else 0

for i in range(1,3):
    if s[i-1] == s[i] and s[i] == 'R':
        ans += 1

print(ans)

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

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

rain_days = 0
max_rain_days = 0
for char in s:
    if char == 'R':
        rain_days += 1
        max_rain_days = rain_days
    elif char == 'S':
        rain_days = 0

print(max_rain_days)

Solution (Python):
S = input()

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

Solution (Python):
s = input()

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

Solution (Python):
from itertools import groupby
S = list(input())
print(max([len(list(v)) for k, v in groupby(S) if k == 'R']+[0]))

Solution (Python):
S=input()
set_S=set(S)
if len(set_S)==1:
    ret=S.count('R')
else:
    if S[0]==S[1]=='R' or S[1]==S[2]=='R':
        ret=2
    else:
        ret=1
print(ret)

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=="SRR":
    print(2)
elif S=="RSR":
    print(1)
elif S=="RRS":
    print(2)
else:
    print(3)

Solution (Python):
s=str(input())[:3]
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()
S_list = list(S)

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):
str = input()
if 'R' in str:
   crs=1
   if 'RR' in str:
      crs=2
      if 'RRR' in str:
         crs=3
else:
    crs=0
print(crs)