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.



Sample input:
RRS


Sample output:
2

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()
s=input()
ans=0
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" or s[1]=="R" and s[2]=="R" and s[0]!="R":
    print(2)
elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
S = input()
count = 0

for i in range(0, 3):
    if S[i] == 'R':
        count += 1

if S[1] == 'S' and count > 1:
    count -= 1

print(str(count))

Submission status: Accepted

Solution code:
n = 0
S = input()
for i in range(0,len(S)):
    if i==0:
        if S[i]=="R":
            n += 1
    if i==1:
        if S[i]=="R":
            n += 1
        else:
            n = 0
    if i==2:
        if S[i]=="R":
            n += 1
        else:
            continue
    if S == "RSS":
        n = 1
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = list(map(str, input()))
c=0
for i in range(3):
  if li[i]=='R':
    c=c+1
    if i!=2 and li[i+1]!='R':
      print(c)
      exit()
print(c)

Submission status: Accepted

Solution code:
s = input()

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

if s[1] == "S" and cnt == 2:
    print(1)
else:
    print(cnt)

Submission status: Accepted

Solution code:
x, y, z = input()
sum=0
if x=='R' and y=='R' and z == 'R':
    print(3)
elif (x=='R' and y=='R') or (y=='R' and z =='R'):
    print(2)
elif x=='R' or y=='R' or z=='R':
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()

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

if s.count("R") == 0:
    print(0)
elif s.count("R") == 1 or s == "RSR":
    print(1)
elif s.count("R") == 2:
    print(2)
elif s.count("R") == 3:
    print(3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

elif S == 'SRR':
  print('2')

elif S == 'RSS' or 'SRS' or 'SSR':
  print('1')
  
elif S == 'SSS':
  print('0')

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
if ("S" not in S):
    print(3)
elif ("R" in S):
    if (S[1] == "S" or S.count("S") == 2):
        print(1)
    else:
        print(2)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
count = 0
m = 0
for w in s:
  if w == 'R':
    count += 1
    m = max(m, count)
  if w == 'S':
    count = 0
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
count=0
S=input()
Rain = S.split('S')
for i in range(len(Rain)):
  Rain[i] = len(Rain[i])
count = max(Rain)
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
L=list(S)

count = 0

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

Submission status: Accepted

Solution code:
a = input()

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

Submission status: Accepted

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

s=inp()
c=0
if s.count("R")==1:
    out(1)
else:
    for i in range(3):
        if s[i]=='R':
            c+=1
        elif s[i]=='S' and i!=2:
            c= 0
    out(c)

Submission status: Accepted

Solution code:
S = input('')
num = 0
num_rev = [0,0,0]
for i in range(3):
    if S[i] == 'R':
        num += 1
    elif S[i] == 'S':
        num_rev[i] = num
        num = 0
        

print(max(num,num_rev[0],num_rev[1],num_rev[2]))

Submission status: Accepted

Solution code:
import re
if __name__ == '__main__':
    s = input()
    m = [len(Rs) for Rs in re.findall('R+', s)]+[0]
    print(max(m))

Submission status: Accepted

Solution code:
a = list(input())

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

Submission status: Accepted

Solution code:
k=input()
a=0
if k[0]=='R':
    if k[1]=='R':
        if k[2]=='R':
            a=3
        else:
            a=2
    else:
        a=1
elif k[1]=='R':
    if k[2]=='R':
        a=2
    else:
        a=1
elif k[2]=='R':
    a=1
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input().strip()
ans = 0
if 'R' in S:
    ans = 1
if 'RR' in S:
    ans = 2
if 'RRR' in S:
    ans = 3
print(ans)

Submission status: Accepted

Solution code:
# from pprint import pprint
# import math
# import collections

s = input()
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
# a = []
# for i in range(n):
#     a.append(int(input()))

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    s = input()

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
a=[]
a=list(input())
count=0
for i in range(3):
  if a[i]=='R':
    count+=1
  elif count!=0:
    break
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
we = input()
jud = list(we)
if jud[1] == "R":
	if jud[0] == "R" and jud[2] == "R":
		print(3)
	elif jud[0] == "R" or jud[2] == "R":
		print(2)
	else:
		print(1)
else:
	if jud[0] == "R" or jud[2] == "R":
		print(1)
	else:
		print(0)

Submission status: Accepted

Solution code:
S = input()
Scnt = S.count('S')
result = 0
result2 = 0

for i in range(3):
    if S[i] == 'R':
        result = result + 1
    else:
        if result2 < result:
            result2 = result
        result = 0
 
if result > result2:
    print(result)
else:
    print(result2)

Submission status: Accepted

Solution code:
# cook your dish here
s = input()
if 'SSS' == s:
    print(0)
elif "RSS" ==s or s=="SRS" or "SSR" == s or "RSR"==s:
    print(1)
elif "RRR" == s:
    print(3)
elif "RRS"==s or "SRR" == s:
    print(2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

def result(s):
    count = 0
    max = 0
    if s == 'RRR':
        max = 3
        return max
    elif s == 'SSR':
        max = 1
        return max
    elif s == 'SRR':
        max = 2
        return max
    elif s == "RSR":
        max = 1
        return max
    for i in s:
        if i == 'R':
            count += 1
        else:
            if max < count:
                max = count
            count = 0
    return max
    

print(result(s))

Submission status: Accepted

Solution code:
def calculate(S):
    arr_string = list(S)
    
    if arr_string.count('R') == 0:
        return 0
    elif arr_string.count('R') == 1:
        return 1
    elif arr_string.count('R') == 3:
        return 3
    else: # return 2, check if it is consecutive?
        if arr_string[1] == 'S':
            return 1
        else:
            return 2
            
S = str(input())            
print(calculate(S))

Submission status: Accepted

Solution code:
s = input()

count = 0
max = 0

for c in s:
    if c == "R":
        count += 1
        if count > max:
            max = count
    elif c == "S":
        count = 0


print(max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans=0

if s.count("R")>0: ans = 1

if s[:2]=="RR": ans = 2
if s[1:]=="RR": ans = 2

if s == "RRR": ans = 3

print(ans)

Submission status: Accepted

Solution code:
temthr = input()
tem1, tem2, tem3 = temthr[:1], temthr[1:2], temthr[2:3]
c = 0
if tem1 == "R":
  if tem2 == "R":
    if tem3 == "R":
      print(3)
    elif tem3 == "S":
      print(2)
  elif tem2 == "S":
    print(1)
if tem1 == "S":
  if tem2 == "R":
    if tem3 == "R":
      print(2)
    elif tem3 == "S":
      print(1)
  elif tem2 == "S":
    if tem3 == "R":
      print(1)
    else:
      print(0)

Submission status: Accepted

Solution code:
def find(s):
  ans=0
  for i in s:
    if i=="R":
      ans+=1
    elif i=="S" and ans>0:
      return ans
  return ans
s=input()
print(find(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = 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)

Submission status: Accepted

Solution code:
x=list(input())
cnt=0
for i in range(3):
 if x[i]=="R":
  cnt+=1
if cnt==0:
 print(0)
elif cnt==1:
 print(1)
elif cnt==2 and x[1]=="S":
 print(1)
elif cnt==2 and x[1]=="R":
 print(2)
elif cnt==3:
 print(3)

Submission status: Accepted

Solution code:
# coding:utf-8
s = input()
count = 0
ans = 0

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

Submission status: Accepted

Solution code:
s = input()

counts = []
count = 1
if s.find('R') == -1:
    count = 0
else:
    for a, b in zip(s, s[1:]):
        if a == b and a == 'R':
            count += 1
        else:
            counts.append((a, count))

print(str(count))

Submission status: Accepted

Solution code:
s = input()
count = 0
max = 0

for i in range(len(s)):
    if s[i] == "R":
        count += 1
        if max < count:
            max = count
    else:
        count = 0

print(max)

Submission status: Accepted

Solution code:
user = str(input())
count = 0
for i in user:
    if i == 'R':
        count += 1
    else:
        count
if count == 3:
        count
elif count == 2:
    if user[0] == user[2]:
        count = 1
    else:
        count = 2
else:
    count = count
print(count)

Submission status: Accepted

Solution code:
# coding: utf-8

w = input()

ans = 0
tmp_ans = 0
for i in range(len(w)):
    if w[i] == "R":
        tmp_ans += 1
        ans = tmp_ans
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0

print(ans)

Submission status: Accepted

Solution code:
s = input()
a = [str(c) for c in s]

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

Submission status: Accepted

Solution code:
s= input()
k='S'
count=0
for i in s:
  if k=='R' and i=='R':
    count+=1
    k='R'
  elif k=='S' and i=='R':
    count=1
    k='R'
  elif i=='S':
    k='S'
print(count)

Submission status: Accepted

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

if b == "R":
  d = 1
  if a == "R":
    d += 1
  if c == "R":
  	d += 1
else:
  d = 0
  if a == "R" or c == "R":
    d += 1
 
print(d)

Submission status: Accepted

Solution code:
s=input()
count=0
m=0
for i in range(len(s)):
    if s[i]=='R':
        count+=1
    else:
        if count > m :
            m=count
        count=0
if count>m:
  m=count
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

r_cnt = 0
max_r_cnt = 0

for s in S:
    if s == "R":
        r_cnt += 1

    else:
        r_cnt = 0
    max_r_cnt = max(r_cnt, max_r_cnt)

print(max_r_cnt)

Submission status: Accepted

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

Submission status: Accepted

Solution code:
c=str(input())
rnum=c.count('R')

if rnum == int(2):
    r2 = c.count('RR')
    if r2 == int(1):
        print(2)
    else:
        print(1)
else:
    print(rnum)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = input()

raining = False
count = 0
max = 0
for w in weather:
    if w == 'R':
        if not raining:
            raining = True
            count = 1
        else:
            count += 1
    elif w == 'S':
        raining = False
        count = 0
    if max < count:
        max = count

print(max)

Submission status: Accepted

Solution code:


L = []
L.append(input())

if L[0] == 'SSS':
	print(0)
elif L[0] == 'RRR':
	print(3)
elif L[0] == 'SSR' or L[0] == 'SRS':
	print(1)
elif L[0] =='RSS':
	print(1)
elif L[0] == 'SRR' or L[0] == 'RRS':
	print(2)
elif L[0] == 'RSR':
	print(1)

Submission status: Accepted

Solution code:
import sys

str = sys.stdin.read()

maximum = 0
count = 0

for c in str:
    if 'R' == c:
        count += 1
    else:
        count = 0

    maximum = max(maximum, count)

print(maximum)

Submission status: Accepted

Solution code:
input_sen=input()
N=0
if input_sen=="RSR":
  N=1
else:
  for i in input_sen:
    if i=="R":
      N+=1
print(N)

Submission status: Accepted

Solution code:
S = input()

l = len(S)
count = 0

for i in range(l):
    if "R" not in S:
        break
    cur_count = 1

    for j in range(i+1,l):
        if S[i] == "S":
            break
        if (S[i] != S[j]):
            break
        cur_count += 1
    if cur_count > count:
        count = cur_count

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


S = input()

len = 0
if 'R' in S:
    len = 1
if 'RR' in S:
    len = 2
if 'RRR' in S:
    len = 3

print(len)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
S = readline().decode().rstrip()
if S[0] == 'R' and S[1] == 'S' and S[2] == 'R':  
    print(S.count('R')-1)
else:
    print(S.count('R'))

Submission status: Accepted

Solution code:
w = list(input())

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

if w == ["S", "S", "S"]:
    print("0")
else:
    if w == ["R", "R", "R"]:
      print("3")
    elif w[1] == "R" and a == 2:
      print("2")
    else:
      print("1")

Submission status: Accepted

Solution code:
S = input()


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans, tmp = 0, 0
for i in range(3):
    if s[i] == "R":
        tmp += 1
    else:
        ans = max(tmp, ans)
        tmp = 0
if ans < tmp:
    ans = tmp
print(ans)

Submission status: Accepted

Solution code:
import sys
li  =   lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw  =   lambda : sys.stdin.readline().strip().split()
ni  =   lambda : int(sys.stdin.readline().strip())
nsi =   lambda : sys.stdin.readline().strip()

from collections import defaultdict as df
from math import *

n=nsi()
count=0
o=0
if(n[0]=='R' and n[1]=='S'):
    print(1)
    o=1
if(n[0]=='R' and n[1]=='R' and n[2]=='S'):
    print(2)
    o=1
if(n[0]=='S'and n[1]=='R' and n[2]=='R'):
    print(2)
    o=1
if(n[0]=='R' and n[1]=='R' and n[2]=='R'):
    print(3)
    o=1

for i in n:
    if(i=='R'):
        count+=1

if(count==0):
    print(0)
if(count==1 and o==0):
    print(1)

Submission status: Accepted

Solution code:
S = input()
count = 0

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def Convert(string): 
    li = list(string.strip()) 
    return li 

s=str(input())

l=[]
l=Convert(s)
#print(l)
x=len(l)
count=0
if(l[0]=='R'):
	count=1
	if(l[1]=='R'):
		count=count+1
		if(l[2]=='R'):
			count=count+1		
	
else:
	if(l[1]=='R'):
		count=count+1
		if(l[2]=='R'):
			count=count+1
	else:
		if(l[2]=='R'):
			count=count+1

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ren = 0

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

Submission status: Accepted

Solution code:
S = input()

if "RRR" in S:
    ans = 3

elif "RR" in S:
    ans = 2
    
elif "R" in S:
    ans = 1
else:
    ans = 0
    
print(ans)

Submission status: Accepted

Solution code:
dict = {
    "SSS":0,"SSR":1,"SRR":2,"RRR":3,"RSR":1,"SRS":1,"RSS":1,"RRS":2
}
print(dict[input()])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = input()
count = 0
renzoku = 0

if num[0] == "R":
    count += 1
    renzoku += 1

if num[1] == "R":
    count += 1
    renzoku += 1
else:
    renzoku = 0

if num[2] == "R":
    count += 1
    renzoku += 1

if count == 1:
    print(count)
else:
    print(renzoku)

Submission status: Accepted

Solution code:
s=input()
if s=='RRR':
    print(3)
elif s=='SRR' or s=='RRS':
    print(2)
elif s.count('R')>0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
N=input()
if N==('SSS'):
    print(0)

if N==('SSR'):
    print(1)

if N==('SRS'):
    print(1)

if N==('RSR'):
    print(1)

if N==('RSS'):
    print(1)

if N==('SRR'):
    print(2)

if N==('RRS'):
    print(2)

if N==('RRR'):
    print(3)

Submission status: Accepted

Solution code:
L = [s for s in input()]
if not 'R' in L:
  print(0)
elif not 'S' in L:
  print(3)
elif L[1] == 'S':
  if 'R' in L :
    print(1)
elif L[0] == 'S':
  if L[2] =='S':
    print(1)
  else:
    print(2)
else:
  print(2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
P = input()
count = 0

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

print(count)

Submission status: Accepted

Solution code:
a = input()
i = 0
m = 0
s = 0
while i < len(a) :
    if a[i] == "R" :
        s = s + 1
    if a[i] == "S" :
        if m < s :
            m = s
        s = 0
    i = i + 1
if m < s :
    m = s
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

compareStr = 'R' * len(S)

while len(compareStr) > 0:
    if compareStr in S:
        break
    compareStr = compareStr[:-1]

print(len(compareStr))

Submission status: Accepted

Solution code:
def resolve():
    weather = input()
    if weather[0] == 'R':
        if weather[1] == 'R':
            if weather[2] == 'R':
                print(3)
            else:
                print(2)
        else:
            print(1)
    else:
        if weather[1] == 'R':
            if weather[2] == 'R':
                print(2)
            else:
                print(1)
        else:
            if weather[2] == 'R':
                print(1)
            else:
                print(0)
resolve()

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

count = 0
maxCount = 0
for c in S:
  if c == 'R':
    count += 1
    if maxCount < count:
      maxCount = count
  else:
    count = 0

print(maxCount)

Submission status: Accepted

Solution code:
s = input()
length = len(s)

before = s[0]
chain = -1
cnt = 0
ans = 0

for a in range(length):
    if s[a] == 'R':
        if chain:
            cnt += 1
        else:
            chain = 1
            cnt += 1
    else:
        chain = -1
        cnt = 0

    ans = max(ans, cnt)

print(ans)

Submission status: Accepted

Solution code:
s=input()
if 'R' not in s:
    print(0)
elif s.count('R')==2:
    if s=="RSR":
        print(1)
    else:
        print(2)
else:
    print(s.count('R'))

Submission status: Accepted

Solution code:
import re
S = input()

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

Submission status: Accepted

Solution code:
S = input()

ans = [0]
for i in range(len(S)):
    if S[i] == "R":
        ans.append(ans[-1] + 1)
    else:
        ans.append(0)
print(max(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

if "RRR" in N:
    print("3")
    exit()

elif "RR" in N:
    print("2")
    exit()

elif "R" in N:
    print("1")
    exit()

else :
    print("0")
    exit()

Submission status: Accepted

Solution code:
_s = input()
cnt = 0
# if(_s[0] == 'R'):
# 	cnt += 1
first = None
for i in range(len(_s)):
	if(_s[i] == 'R'):
		if first is not None:
			if(_s[i] == _s[i-1]):
				cnt += 1
		if first is None:
			cnt += 1
			first = True
print(cnt)

Submission status: Accepted

Solution code:
s = input()
c = 0
if s[0] == "R":
  c = c+1
  if s[1] == "R":
    c = c+1
    if s[2] == "R":
      c = c+1

if s[0] != "R":
  if s[1] == "R":
    c = c+1
    if s[2] == "R":
      c = c+1 
    
if s[0] != "R":
  if s[1] != "R":
    if s[2] == "R":
      c = c+1

print(c)

Submission status: Accepted

Solution code:
S = input()

ans = 0
if S == 'RRR':
    ans = 3
elif 'RR' in S:
    ans = 2
elif 'R' in S:
    ans = 1

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = 'S'
r = 'R'

x = input()
unko = list(x)
count = 0
for i in unko:
    if i == 'R':
        count = count + 1
if x == 'RSR':
    count = 1
print(count)

Submission status: Accepted

Solution code:
s = str(input())
count = 0

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

if s[1] == 'S' and count == 2:
    ans = 1

print(ans)

Submission status: Accepted

Solution code:
weatherList = list(input())
totalcount = 0

if weatherList[0] == "R":
  totalcount += 1
  if weatherList[1] == "R":
    totalcount += 1
    if weatherList[2] == "R":
      totalcount += 1
      
elif weatherList[1] == "R":
  totalcount += 1
  if weatherList[2] == "R":
    totalcount += 1
    
elif weatherList[2] == "R":
  totalcount += 1

print(totalcount)

Submission status: Accepted

Solution code:
def main():
    S = input()
    answer = solve(S)
    print(answer)


def solve(S):
    patterns = {
        'SSS': 0,
        'SSR': 1,
        'SRS': 1,
        'SRR': 2,
        'RRR': 3,
        'RRS': 2,
        'RSR': 1,
        'RSS': 1
    }

    return patterns[S]


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
ans = 0
k = 0
for i in s:
    if i == 'R': k += 1
    else:
        if k > ans: ans = k
        k = 0
if s.endswith('R') and k > ans: ans = k
print(ans)