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

Solution (Python):
S = input()

a = 0
for i in range(3):
    if S[i] == "R":
        a += 1

ans = 0
if a == 0:
    ans = 0
elif a == 1:
    ans = 1
elif a == 2:
    if S[1] == "R":
        ans = 2
    else:
        ans = 1
else:
    ans = 3

print(ans)

Solution (Python):
s=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=='SSS':
    print(0)
if s=='SRS':
    print(1)
if s=='SSR':
    print(1)

Solution (Python):
def main():
    ss = list(input())
    r_count = ss.count("R")
    if r_count == 2 and ss[0] == "R" and ss[2] == "R":
        ans = 1
    else:
        ans = r_count
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
l=list(str(input()))
l.insert(0,"S")
ans=0
tot=0
for i in range(4):
    if(l[i]=="R"):
        if(l[i-1]=="R"):
            ans+=1
            if(ans>tot):
                tot=ans
        elif(l[i-1]=="S"):
            ans=1
            if(ans>tot):
                tot=ans
print(tot)

Solution (Python):
a=list(input())
cnt=0
ans=0
for i in a:
  if i=="R":
    cnt+=1
  else:
    ans=max(cnt,ans)
    cnt=0
ans=max(cnt,ans)
print(ans)

Solution (Python):
s=input()
l=[]
count=0
for i in range(3):
    if s[i]=='R':
        count+=1
    else:
        l.append(count)
        count=0 
    if i==2 and s[i]=='R':
        l.append(count)
print(max(l))

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

Solution (Python):
import sys

S=input()
ans=0
ans=S.count("R")
if ans==2 and S[1]=="S":
    print("1")
    sys.exit()
print(ans)

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

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

    print(ans)

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.count('R'):
    print(1)
else:
    print(0)

Solution (Python):
s = list(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()
    else:
      print(0)

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=input()
a=s.count('R')
if a==0:
    print(a)
elif s[1]=='S' and a==2:
    print(a-1)
else:
    print(a)

Solution (Python):
def main():
    a = (input())
    if a.find("RRR")!=-1:
        print(3)
    elif a.find("RR")!=-1:
        print(2)
    elif a.find("R")!=-1:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main()

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[1] == 'S':
  if 'R' in s:
    print(1)
  else:
    print(0)
else:
  if s[0] == 'R' or s[2] == 'R':
    if 'S' in s:
      print(2)
    else:
      print(3)
  else:
    print(1)

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

t = 0
max_t = 0

for i,s in enumerate(S):
    if s == 'R' and t == 0:
        t = 1
    elif s == 'R' and S[i-1] == 'R':
        t+=1
    else:
        t = 0
    max_t = max(max_t,t)
print(max_t)

Solution (Python):
k = input()

if 'R' not in k:
    print(0)

elif k == 'RRS' or k == 'SRR':
    print(2)

elif k == 'RRR':
    print(3)

else:
    print(1)

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

count = 0
flag = 0

if S[0] == "R":
    flag = 1

for x in range(1,len(S)):
    if S[x] == "R":
        flag = 1
    if S[x-1] == "R" and S[x] == "R":
        count += 1

print(count + flag)

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)
elif S == 'RRR':
    print(3)

Solution (Python):
s=input()

ans=0
if s[0]=="R":
    ans+=1
    if s[1]=="R":
        ans+=1
        if s[2]=="R":
            ans+=1
elif s[1]=="R":
    ans+=1
    if s[2]=="R":
        ans+=1
elif s[2]=="R":
    ans+=1

print(ans)

Solution (Python):
S = str(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):
S = input()

count = 0
ans = 0
ansR = 0
for s in S:
  if s == "R":
    count += 1
    ansR = count
  else:
    ans = count
    count = 0


print(max(ans, ansR))

Solution (Python):
def main():
    S = input()
    if S.count('R') != 0:
        out = 1
    else:
        out = 0
    if S == 'RRR':
        out = 3
    if (S == 'SRR') or (S == 'RRS'):
        out = 2
    print(out)


if __name__ == '__main__':
    main()

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

Solution (Python):



import sys
import glob

class InputGenerator(object):
    def __init__(self, input_path=None):
        if input_path != None:
            self.g = self.input_generator(input_path)
        else:
            self.g = None

    def input_generator(self, input_path):
        with open(input_path) as f:
            for line in f:
                yield line

    def get_input(self):
        if self.g == None:
            return input()
        else:
            return next(self.g)

def solve(gen):
    l = gen.get_input().rstrip()
    num_days = 0
    num_days_max = 0
    for s in l:
        if s == 'R':
            num_days += 1
        else:
            if num_days > num_days_max:
                num_days_max = num_days
            num_days = 0

    if num_days > num_days_max:
        num_days_max = num_days

    print(num_days_max)

if __name__ == '__main__':
    test_flag = len(sys.argv) > 1

    if test_flag == True:
        file_path_list = sorted(glob.glob('test/*'))
    else:
        file_path_list = [None]

    for file_path in file_path_list:
        gen = InputGenerator(file_path)
        solve(gen)

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

Solution (Python):
S = input()


count = S.count('R')

if count == 0 or count == 1 or count == 3:
    print(count)
else:
    if S == 'RRS' or S == 'SRR':
        print(count)
    elif S == 'RSR':
        print(1)

Solution (Python):
S = input()
W = ['SSS','SSR','SRS','SRR','RSS','RSR','RRS','RRR']
D = [0,1,1,2,1,1,2,3]
print(D[W.index(S)])

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

Solution (Python):
s = input()

count = 0
maxcount = count
for i in range(3):
    if s[i] == 'R':
        count += 1
    else:
        if maxcount < count:
            maxcount = count
        count = 0
if maxcount < count:
    maxcount = count
print(maxcount)

Solution (Python):
while True:
    try:
        x=input()
        p=0
        if x=='SRR'or x=="RRS":
            print(2)
        elif x=="RRR":
            print(3)
        elif x=='SSS':
            print(0)
        else:
            print(1)
    except:
        break

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

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

    cnt = 0
    if s[0] == 'R':
        cnt = 1

    if s[1] == 'R':
        if s[0] == 'R':
            cnt = 2
        else:
            cnt = 1

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

    print(cnt)    

 

if __name__ == '__main__':
    main()

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

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

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

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

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

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

Solution (Python):
s = input()

s_list = list(s)


ans  = 0
number_of_consecutive_times = 0
for ss in s_list:
    if ss == 'R':
        number_of_consecutive_times += 1
    else:
        number_of_consecutive_times = 0
    ans = max(ans, number_of_consecutive_times)
print(ans)

Solution (Python):
s = 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()
s=list(s)
s_c = s.count('R')
if s[1]=='S' and s_c==2:
  s_c=1
print(s_c)

Solution (Python):


import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line.strip())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    s = lines[0]
    

    return (s, )


def solve(s):

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


def main():
    
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Solution (Python):
S=list(input())
a,b=0,0
for i in S:
    if i=="R":
        a+=1
    else:
        if a>b:
            b=a
        a=0
if a>b:
    b=a
print(b)

Solution (Python):
def resolve():
    s = list(input())
    cnt = 0
    m_cnt = 0
    for c in s:
        if c == 'R':
            cnt += 1
            if cnt > m_cnt:
                m_cnt = cnt

        else:
            cnt = 0

    print(m_cnt)

resolve()

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

Solution (Python):
def main():
    S = input()
    c = 0
    m = 0
    for s in S:
        if s == 'R':
            c += 1
        else:
            c = 0
        m = max(c, m)

    return m

print(main())

Solution (Python):
S = input()
A = [0, 0]
for i in range(len(S)):
    if S[i] == 'R':
        A[1] = A[1]+1
        A[0] = max(A[0], A[1])
    else:
        A[1] = 0
print(A[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):
s = input()
if s == 'RRR':
    ans = 3
elif s == 'SRR':
    ans = 2
elif s == 'RRS':
    ans = 2
elif s == 'RSR':
    ans = 1
elif s == 'RSS':
    ans = 1
elif s == 'SRS':
    ans = 1
elif s == 'SSR':
    ans = 1
elif s == 'SSS':
    ans = 0
print(ans)

Solution (Python):

s = input()

c = 0
r = 0

for i in range(3):
	if s[i] == 'R':
		c += 1
		if r < c:
			r = c
	else:
		c = 0

print(r)

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

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

num=sum([i=='R' for i in s])
if num==2:
  if s[1]!='R':num=1
print(num)

Solution (Python):
S = input()

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

Solution (Python):
s = input()
rain = 0
count = 0
for i in s:
    if i == "R":
        count+=1
    else:
        rain = max(rain, count)
        count = 0
rain = max(rain, count)
print(rain)

Solution (Python):
s_in = str(input())
s = list(s_in)
ans = 0
rain = 0
for i in range(3):
    if s[i]== 'R':
        if rain == 1:
            ans += 1
        else:
            ans = 1
        rain = 1
    else:
        rain = 0
print(ans)

Solution (Python):
s = input()
ans = 0
if s.count('R') > 0:
    ans = 1
if s[0] == 'R' and s[1] == 'R':
    ans = 2
if s[2] == 'R' and s[1] == 'R':
    ans = 2
if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
    ans = 3
print(ans)

Solution (Python):
s = input()

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

Solution (Python):
s=input()
s=str(s)
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]=='S' and s[1]=='S' and s[2]=='S'):
  print(0)
else:
  print(1)

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

Solution (Python):

S=str(input())

Sa=S.split("S")
ans=0
for i in Sa:
    if ans<len(i):
        ans=len(i)
print(ans)

Solution (Python):
def main():
    S = str(input())
    A0 = ('SSS')
    A1 = ('RSS','SRS','SSR','RSR')
    A2 = ('RRS','SRR')
    A3 = ('RRR')
    if S in A0:
        print(0)
    elif S in A1:
        print(1)
    elif S in A2:
        print(2)
    elif S in A3:
        print(3)
    
if __name__ == '__main__':
    main()

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

Solution (Python):
s = input()

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

Solution (Python):
a = str(input())
ans = 0
count = 0
if a[1] == "R" :
  count = count + 1
  if a[0] == "R" and a[2] == "R" :
    count = count + 2
  elif a[0] == "S" and a[2] == "S" :
    count = 1
  else :
    count = count + 1
else :
  if a[0] == "R" and a[2] == "R" :
    count = count + 1
  elif a[0] == "S" and a[2] == "S" :
    count = 0
  else :
    count = count + 1
ans = count
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 = 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 == "RRS" or s == "SRR":
    print(2)
else:
    for i in range(3):
        if s[i] == "R":
            print(1)
            break
        elif i == 2:
            print(0)

Solution (Python):
s = str(input())
count = 0
lst = []

for i in range(3):
    if s[i] == 'R':
        count += 1
    else:
        lst.append(count)
        count = 0

    if i == 2:
        lst.append(count)

max_count = max(lst)
print(max_count)

Solution (Python):

string = input()
count = 0
max_count = 0
for s in string:
    if s == 'R':
        count += 1
    else:
        if count > max_count:
            max_count = count
        count = 0

    if count > max_count:
            max_count = count

print(max_count)

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

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


s_count = rs.count('S')
ans = 0

if s_count == 1:
    if rs[1] == 'S':
        ans = 1
    else:
        ans = 2
elif s_count == 2:
    ans = 1
elif s_count == 0:
    ans = 3
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()
suc=0
ans=0
for i in range(3):
    if S[i]=='R':
        suc+=1
        ans=max(ans,suc)
    else:
        suc=0
print(ans)

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):
S = str(input())
ans = 0

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

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

x=s.count('R')

if s[1]=='S':
  if x==2:
    x-=1
    
print(x)

Solution (Python):
S = input()
count = S.count("R")

if count == 3:
	print(3)
elif count == 2:
	if S[1] == "S":
		print(1)
	else:
		print(2)
elif count == 1:
	print(1)
elif count == 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):
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()
ans = 0
tmp = 0
for i in s:
    if i == "R":
        ans += 1
    else:
        tmp = max(ans,tmp)
        ans = 0
print(max(tmp,ans))

Solution (Python):
"""
    Satwik_Tiwari ;) .
    14th AUGUST , 2020  - FRIDAY
"""



from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  
from itertools import combinations as comb 
from itertools import permutations as permutate
from bisect import bisect_left as bl


from bisect import bisect_right as br
from bisect import bisect





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


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)





from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func





mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") 
def out(var): sys.stdout.write(str(var))  
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())

def zerolist(n): return [0]*n
def nextline(): out("\n")  
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     
    x = x % p  
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : 
            res = (res * x) % p

        y = y >> 1      
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True




def solve():
    s = inp()

    ans = 0
    for i in range(3):
        for j in range(i,4):
            
            if(s[i:j]=='R'*(j-i)):
                ans = max(ans,j-i)
    print(ans)





testcase(1)

Solution (Python):
S = input()

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

Solution (Python):
S = input()
try:
  S.index('RRR')
  print(3)
except:
  try:
    S.index('RR')
    print(2)
  except:
    try:
      S.index('R')
      print(1)
    except:
      print(0)

Solution (Python):


s = str(input())

count = 0
ans = 0

for i in s:
    if i == "R":
        count += 1
    elif i == "S":
        count = 0
    ans = max(ans,count)

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

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

Solution (Python):
n = input()

cnt = 0
flag = False
if n[1] == 'S':
    if 'R' in n:
        print(1)
        flag = True
    else:
        print(0)
        flag = True
if flag == False:
    for i in n:
        if i == 'R':
            cnt += 1
    print(cnt)

Solution (Python):
S =str(input())
rainydays=0
for i in S:
    if i =='R':
        rainydays+=1
if S[1]=='S':
    if rainydays==2:
        rainydays=1
print(rainydays)

Solution (Python):
s=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
if 'RRR' in S:
    ans = 3
elif 'RR' in S:
    ans = 2
elif 'R' in S:
    ans = 1
else:
    ans = 0

print(ans)

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

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

if __name__ == '__main__':
    main()

Solution (Python):
s = str(input())
count = []
x = 0 
for i in range(len(s)):
    if s[i] == "R":
        x += 1
        if i == len(s)-1:
            count.append(x)
    if s[i] == "S":
        count.append(x)
        x = 0

print(max(count))

Solution (Python):
s=str(input())
c=s.count("R")
if c>=1 and s[1]=="S":
    print(1)
else:
    print(c)

Solution (Python):
import sys
from itertools import product,combinations
from functools import reduce,lru_cache
import heapq

def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

s=reader()

print(max(vfunc(len)(s[0][0].split('S'))))

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

Solution (Python):
x = input()
ans=0
tmp_ans=0
for i in x:
    if i=="R":
        tmp_ans+=1
    else:
        if ans<tmp_ans:
            ans=tmp_ans
            tmp_ans=0
else:
    if ans<tmp_ans:
            ans=tmp_ans
            tmp_ans=0
print(ans)

Solution (Python):
import itertools
S = input()

cnt = 0
gr = itertools.groupby(S)
for key, group in gr:
    if key == "R":
        cnt = max(cnt, len(list(group)))

print(cnt)

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

Solution (Python):
s = input()

w1 = s[0]
w2 = s[1]
w3 = s[2]

if w2 == 'R':
	if w1 != w3:
		print(2)
	elif w1 == 'S':
		print(1)
	else:
		print(3)
else:
	if w1 != w3:
		print(1)
	elif w1 == 'S':
		print(0)
	else:
		print(1)

Solution (Python):
s = input()

if s == "SSS":
    print(0)
    exit()

cnt = 1
if s[0] == "R" and s[1] == "R":
    cnt += 1
if s[2] == "R" and s[1] == "R":
    cnt += 1

if cnt == 1:
    print(cnt)
else:
    print(cnt)

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

Solution (Python):


import sys
import math
import time

import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools










S = str(input())
flag = 2
ans = 0

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

print(ans)

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

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

Solution (Python):
s=input()
ans=0
for i in range(3):
	if s[i]=='R':
		ans+=1
if ans>=1 and s[1]!='R':
	ans=1
print(ans)

Solution (Python):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

S = s()
if 'R' not in S:
    ans = 0
else:
    ans = 1
for i in range(2):
    if S[i] == S[i+1] == 'R':
        ans = 2
if 'S' not in S:
    ans = 3
print(ans)

Solution (Python):
s = input().rstrip()

print(max(map(len, s.split('S'))))

Solution (Python):
S = input()

counts = []
count = 0
for s in S:
    if s =='R':
        count += 1
    else:
        counts.append(count)
        count = 0

counts.append(count)
ret = max(counts)
print(ret)

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

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()
S=list(s)

num=S.count('R')

if num==2:
    if s=='RSR':
        print("1")
    else:
        print('2')
else:
    print(num)

Solution (Python):
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    S = input()
    count = 0
    for i in S:
        if i == 'R':
            count += 1
    if count == 0:
        print(0)
    elif count == 1:
        print(1)
    elif count == 3:
        print(3)
    else:
        if S[1] == 'R':
            print(2)
        else:
            print(1)


if __name__ == '__main__':
    solve()

Solution (Python):
S = input()

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

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