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:
D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)

Submission status: Accepted

Solution code:
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    S = input()
    answer = 0
    ans_list = [0]
    for i in range(3):
        if S[i] == "R":
            answer += 1
        if S[i] == "S":
            ans_list.append(answer)
            answer = 0
    ans_list.append(answer)
    print(max(ans_list))


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
answer  = 0
current = 0
for ch in s:
    if ch == "R":
        current += 1
    else:
        current = 0
    answer = max(answer, current)
 
print(answer)

Submission status: Accepted

Solution code:
S = input()
n = S.count('R')

if n == 2:
    if S == 'RSR':
        print(1)
    else:
        print(2)
else:
    print(n)

Submission status: Accepted

Solution code:

flag = True
count = 0
l = []

for s in input():
    if flag:
        if s == "R":
            count += 1
            l.append(count)
        else:
            l.append(0)
            count = 0


print(max(l))

Submission status: Accepted

Solution code:
s = input()
answer  = 0
current = 0
for ch in s:
    if ch == "R":
        current += 1
    else:
        current = 0
    answer = max(answer, current)

print(answer)

Submission status: Accepted

Solution code:
s = input()
if s == 'RRR':
    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 S[0] == 'R' and S[1] == 'R' and S[2] == 'R':
    ans = 3
elif (S[0] == 'R' and S[1] == 'R' and S[2] == 'S') or (S[0] == 'S' and S[1] == 'R' and S[2] == 'R'):
    ans = 2
elif S[0] == 'S' and S[1] == 'S' and S[2] == 'S':
    ans = 0
else:
    ans = 1

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n)


if __name__ == '__main__':
    print(check_weather(input()))

Submission status: Accepted

Solution code:
def check_weather(weathers: str) -> int:
    count = weathers.count('R')
    return 1 if weathers[1] == 'S' and count == 2 else count

if __name__=='__main__':
    print(check_weather(input()))

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 = str(input())
le = len(S)
s = []

for i in range(le):
    s.append(S[i])

r = s.count("R")

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

Submission status: Accepted

Solution code:
s = list(input())

ans = 0
a = 0
for i in range(len(s)):
    if s[i] == 'R':
        a += 1
    else:
        a = 0
    ans = max(ans,a)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input().strip()
res, tmp = 0, 0

for c in s:
    if c == 'R':
        tmp += 1
        res = max(res, tmp)
    else:
        tmp = 0

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
count = 0
mcount = 0
for i in range(len(S)):
	if(S[i] == 'S'):
		count = 0
	elif(S[i] == 'R'):
		count += 1
		if(count>mcount):
			mcount = count
print(mcount)

Submission status: Accepted

Solution code:
import sys

n = list(input())
n1 = ['R','S','R']

i = 0
cou = 0
if n == n1:
    print(1)
    sys.exit()
while i != len(n):
    if n[i] == 'R':
        cou += 1
    i += 1
print(cou)

Submission status: Accepted

Solution code:
s = input()

if s == "S" :
    print('天気が雨である日が連続していた最大の日数を入力せよ')
elif 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 = input()
n = s.count('R')

if(n==3):
    print(3)
    exit()

if(n==2):
    if(s=='RSR'):
        print(1)
    else:
        print(2)
    exit()

if(n==1):
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=str(input())
 
if S.count('R')==0:
  print(0)
if S.count('R')==1 :
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1 and not S.count('RRR')==1:
  print(2)
if S.count('RRR')==1:
  print(3)

Submission status: Accepted

Solution code:
s = list(input())

days = 0
if s[1] == "R":
  days += 1
  if s[0] == "R":
    days += 1
  if s[2] == "R":
    days += 1
    
else:
  if s[0] == "R" or s[2] == "R":
    days = 1
    
print(days)

Submission status: Accepted

Solution code:
#akash mandal: jalpaiguri government engineering college
import sys,math

def ii(): return int(input())
def mii(): return map(int,input().split())
def lmii(): return list(mii())


def main():
    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)
        
        
      
        
    
    
    
            
        
            
    
        
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
if s[0] == s[1] == s[2] == "R":
    print(3)
elif s[0] == s[1] == "R" or s[1] == s[2] == "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()

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 "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 '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()
n=0
m=0
for i in range(len(s)):
    if s[i]=='S':
        n=0
    else:
        n+=1
        m=n
print(m)

Submission status: Accepted

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

for i in range(len(s)):
    if s[i] == 'S':
        count =0
    else:
        count += 1
        if count > max:
            max = count

print(max)

Submission status: Accepted

Solution code:
s=input()
l=[['SSS'],['RSS','SRS','SSR','RSR'],['RRS','SRR'],['RRR']]
for i in range(4):
  if s in l[i]:
    print(i)
    exit()

Submission status: Accepted

Solution code:
s = input()
if s[0] == s[1] == s[2] == 'R':
  print(3)
elif s[0] == s[1] == 'R' or s[1] == s[2] == '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:
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    s = str(readline().rstrip().decode('utf-8'))
    if s == "RRR":
        print(3)
    elif s == "RRS" or s == "SRR":
        print(2)
    elif s.count("R") == 0:
        print(0)
    else:
        print(1)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n = input()

rcount = 0
m = 0
for i in n:
  if i == "R":
    rcount += 1
  else:
    rcount = 0
  
  if m <= rcount:
    m = rcount
print(m)

Submission status: Accepted

Solution code:
n = input()

rcount = 0
m = 0
for i in n:
  if i == "R":
    rcount += 1
  else:
    rcount = 0
  
  if m <= rcount:
    m = rcount
print(m)

Submission status: Accepted

Solution code:
s=str(input())
count=0
L=[]
for i in range(0,len(s)):
	if(s[i]=="R"):
		count+=1
	else:
		count=0
	L.append(count)
print(max(L))

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 = input()
c = 0
a = 0
for i in s:
    if i == 'R':
        c += 1
        a = c
    else:
        c = 0
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:
import re

x = input()
pattern = "R+"
pat = re.search(pattern, x)
if pat:
  print(len(pat.group()))
else:
  print(0)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    S = input()
    cnt = 0
    mx = 0
    for i in range(len(S)):
        if (S[i] == 'R'):
            cnt += 1
        else:
            cnt = 0
        mx = max(mx, cnt)
    print(mx)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main(S):
    rains = S.split('S')
    return max([len(r) for r in rains])

if __name__ == '__main__':
    S = input()
    ans = main(S)
    print(ans)

Submission status: Accepted

Solution code:
a=input()
if a=="SSS": print(0)
elif a=="RRR":print(3)
elif a in ["SSR","SRS","RSS","RSR"]:print(1)
else:print(2)

Submission status: Accepted

Solution code:
print(len(max(input().split('S'))))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools as fts
import itertools as its
import math
import sys

INF = float('inf')


def solve(S: str):
    return sum([S == "RRR", "RR" in S, "R" in S])


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    print(f'{solve(S)}')


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
#A問題

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

Submission status: Accepted

Solution code:
s = input()
n = ans = 0
for c in s:
    if c == "S":
        n = 0
        continue
    n += 1
    if n > ans:
        ans = n
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if "RRR" in s:
    print(3)
elif "RR" in s and "S" in s:
    print(2)
elif s.count("R") == 1 or "RSR" in s:
    print(1)
elif s.count("R") == 0:
    print(0)

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

Submission status: Accepted

Solution code:
A = input()

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

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

count = 0
max = 0

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

print(max)

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

Submission status: Accepted

Solution code:
c = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(3):
    if s[i] == "R":
        ans = 1

for i in range(2):
    if s[i:i+2] == "RR":
        ans = 2

if s == "RRR":
    ans = 3

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
a = []

for i in s:
	if i == 'R':
		ans += 1
	else :
		ans = 0
	a.append(ans)
print(max(a))

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
a =input ()
k = 0
for i in range(3):
  if a[i]== "R":
    k=k+1
if a=="RSR":
  k=1
print (k)

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=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:
#                               #
    # author : samars_diary #
    # 13-09-2020 │ 12:48:09 #
#                               #

import sys, os.path

if(os.path.exists('input.txt')):
    sys.stdin = open('input.txt',"r")
    #sys.stdout = open('output.txt',"w")

sys.setrecursionlimit(10 ** 5)

def mod(): return 10**9+7
def i(): return sys.stdin.readline().strip()
def ii(): return int(sys.stdin.readline())
def li(): return list(sys.stdin.readline().strip())
def mii(): return map(int, sys.stdin.readline().split())
def lii(): return list(map(int, sys.stdin.readline().strip().split()))

#print=sys.stdout.write

def solve():
    a=li();b=ans=0
    if 'R' not in a:
        print(b)
    else:
        for i in range(len(a)):
            if a[i]=='R': b+=1 ; ans=max(ans,b)
            else: b=0
        print(ans)
solve()

Submission status: Accepted

Solution code:
S = input()
count = 0
max_c = 0

for i in S:
    if i != 'R':
        count = 0
    else:
        count = count + 1
    
    if max_c < count:
        max_c = count
    
print(max_c)

Submission status: Accepted

Solution code:
a=input()
flag=0
for i in range(3):
  if(a[i]=='R'):
    flag+=1;
  
if flag==1 or flag==3 or flag==0:
  print(flag)
elif flag==2 and a[1]=='R':
  print(flag)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if s[0] == s[1] and s[1] == s[2] and s[1] =='R':
    print('3')
elif (s[0] == s[1] or s[1] == s[2]) and s[1]=='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().split("S")
print(len(max(S)))

Submission status: Accepted

Solution code:
s=input().split("S")

print(len(max(s)))

Submission status: Accepted

Solution code:
s = input()

ans = 0
for ch in s:
    if ch == 'R':
        ans += 1

if ans == 2 and s[1] == 'S':
    print(1)
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()


ans = 0
if S.find("RRR") >= 0:
    ans = 3
elif S.find("RR") >= 0:
    ans = 2
elif S.find("R") >= 0:
    ans = 1

    
print(ans)

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 "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:
import math
import collections
import itertools

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

resolve()

Submission status: Accepted

Solution code:
s = input()
count = 0
for i in range(3):
  if s[i] == 'R':
    count+=1
if count <= 1 or count == 3:
  print(count)
elif s[1] != 'R':
  print(count-1)
else:
  print(count)

Submission status: Accepted

Solution code:
data = input()

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

Submission status: Accepted

Solution code:
s = input()
ans = 0

if "RRR" == s:
    ans = 3
elif "RR" in s:
    ans = 2
elif "R" in s:
    ans = 1

print(ans)

Submission status: Accepted

Solution code:

def main():
    s = input()
    if s[1] == "S":
        if s[0] == "R" or s[2] == "R":
            print(1)
        else:
            print(0)
    else:
        count = 0
        for i in range(3):
            if s[i] == "R":
                count += 1
        print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

if "RRS" in S or "SRR" in S:
    print(2)

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

elif "RRR" in S: 
    print(3)

else:
    print(1)

Submission status: Accepted

Solution code:
s = input()

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

elif s == "RRS" or s == "SRR":
    print("2")

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

else:
    print("1")

Submission status: Accepted

Solution code:
S = input()
 
 
D = S.count("R")
 
if D == 1:
    print(1)
 
elif D == 3:
    print(3)
 
elif D == 2:
    for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
 
elif D == 0:
    print(0)

Submission status: Accepted

Solution code:
S = input()

#print(S.count("R"))

con = S.count("R")

if con == 1:
    print(1)

elif con == 3:
    print(3)

elif con == 2:
    for j in range(3):
        if S[j] =="R":
            if S[j+1] =="R":
                print(2)
                break

            else:
                print(1)
                break

elif con == 0:
    print(0)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s=input()

a="RRR"
b="RR"
c="R"


if a in s:
    print(3)
elif b in s:
    print(2)
elif c in s:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
c = s.count('R')
if c == 2 and s[1] == 'S':
    c = 1
print(c)

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 ("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()
sum = 0
for i in range(3):
    if S[i]=="R":
        sum += 1
if sum == 2 and S[1] == "S":
        sum = 1
print(sum)

Submission status: Accepted

Solution code:
D = list(input())
ans = 0
cnt = 0

for i in D:
  if i == 'R':
    cnt += 1
  else:
    cnt = 0
  if ans < cnt:
    ans = cnt
print(ans)

Submission status: Accepted

Solution code:
# # abc175_a.py
S = input()
ans  = [0]
cnt = 0
for i in S:
    if i =="S":
        ans.append(cnt)
        cnt = 0
    else:
        cnt+=1
print(max(max(ans),cnt))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for r in s:
    if r == 'R':
        ans += 1
if ans == 2 and s == 'RSR':
    print(1)
else:
    print(ans)

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

Submission status: Accepted

Solution code:
s = input()
map = {'SSS': 0, 'SSR': 1, 'SRS': 1, 'RSS': 1, 'SRR': 2, 'RSR': 1, 'RRS': 2, 'RRR': 3}
for key in map.keys():
    if s == key:
        print(map[key])
        break

Submission status: Accepted

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

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

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

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

elif "R" in S:
    print(1)

else:
    print(0)

Submission status: Accepted

Solution code:
r = list(input())
if r == ["R","S","R"] or r==["R","S","S"] or r==["S","S","R"] or r==["S","R","S"]:
  print(int(1))
elif r ==["R","R","S"] or r==["S","R","R"]:
  print(int(2))
elif r==["S","S","S"]:
  print(int(0))
else:
  print(int(3))

Submission status: Accepted

Solution code:
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

s = inp()

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

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
weather = input()

seq = 0
prev = False
for i in range(3):
    if weather[i] == 'R':
        if prev:
            seq += 1
            prev = True
        else:
            seq = 1
            prev = True
    else:
        prev = False
            
print(seq)

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

r = ["RRS","RRR","RSR","SRR","SSR","RSS","SSS","SRS"]
ra = [2,3,1,2,1,1,0,1]
for i in range(8):
    if r[i] == s:
        print(ra[i])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = list(input())

i = 0
j = 0
days = 0
consecutive = []

while i <= 2:
    while i + j <= 2:
        if weather[i+j] == "R":
            days += 1
            j += 1
        else:
            break
    i += 1
    j = 0
    consecutive.append(days)
    days = 0

print(max(consecutive))

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 = input()
res = 0
cur = 0
for i in s:
  if i =='S':
    cur = 0
  else:
    cur += 1
  res = max(cur, res)
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()

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

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

if __name__ == '__main__':
    S = sys.stdin.readline()
    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('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()
ans=0
 

for i in range(1,4):
  R = 'R'*i
  if R in s:
    ans = i
    
print(ans)