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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
A= S[0]
B=S[1]
C=S[2]
L=list([A,B,C])
Rcount = S.count('R')
if Rcount ==0:
    print(0)
elif Rcount ==1:
    print(1)
elif Rcount == 3:
    print(3)
else:
    if B == 'R':
        print(2)
    else:
        print(1)

Submission status: Accepted

Solution code:
S = list(input())
flag = False
count = 0
max_ = 0
for i in range(3):
    if flag == True:
        if S[i] == "R":
            count += 1
        else:
            flag = False
            count = 0
    else:
        if S[i] == "R":
            count += 1
            flag = True
    if count > max_:
        max_ = count
print(max_)

Submission status: Accepted

Solution code:
# coding: utf-8
str_input = input()

counter = 0

counter = str_input.count("R")

if counter == 3 and str_input[1] in "R":
    pass
elif counter == 2 and str_input[1] in "R":
    pass
elif counter == 2 and str_input[1] in "S":
    counter -= 1
print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
a = 0
if S == 'RSR':
    print(1)
else:
    for i in S:
        if i == 'R':
            a += 1
    print(a)

Submission status: Accepted

Solution code:
s = list(input())
opt = 0
if (s[0] == 'S'):
    if (s[1] == 'R'):
        opt += 1
    if (s[2] == 'R'):
        opt += 1
    print(opt)
    exit()
if (s[0] == 'R'):
    opt += 1
if (s[1] == 'R'):
    if (s[1] == 'R'):
        opt += 1
    if (s[2] == 'R'):
        opt += 1

print(opt)

Submission status: Accepted

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

import sys
import argparse
import logging
#import math

logging.basicConfig(filename='logger.log', level=logging.DEBUG)
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)


def f(s: str) -> int:
    '''
    >>> f("SSS")
    0
    >>> f("RRS")
    2
    >>> f("RRR")
    3
    >>> f("RSR")
    1
    '''
    result = 0
    n = 0
    for c in list(s):
        if c == 'R':
            n += 1
        else:
            n = 0
        result = max(result, n)
    return result


if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument(
            '--doctest', action='store_true', default=False)
    args = parser.parse_args()
    if args.doctest:
        import doctest
        doctest.testmod(verbose=True)
        sys.exit()

    s = sys.stdin.readline().rstrip()
    print(f(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(max([len(t) for t in input().split('S')]))

Submission status: Accepted

Solution code:
import sys
import  math
import fractions
from collections import defaultdict
stdin = sys.stdin
     
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
emp = 0
l = a.split('S')
while("" in l):
   l.remove("")
if not l:
   print(emp)
else:
   print(len(l[0]))

Submission status: Accepted

Solution code:
S = list(input())


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

elif (S[1] == 'R') and (S[0] == S[1] or S[1] == S[2]):
    i = 2

elif (S[0] == S[1] and S[2] == 'S'):
    i = 0

else:
    i = 1

print(i)

Submission status: Accepted

Solution code:
from itertools import groupby
maxs = 0
given = groupby(input())
for i, v in given:
    if i == "R":
        maxs = max(maxs, len(list(v)))
print(maxs)

Submission status: Accepted

Solution code:
# a,b = map(int, input().split())
s = input()
c = s.count("R")

if c == 1:
    print(c)
elif c == 2:
    if s[0] == s[1]:
        print(c)
    elif s[1] == s[2]:
        print(c)
    else:
        print(1)
elif c == 3:
    print(3)
elif c == 0:
    print(0)

Submission status: Accepted

Solution code:
s = input()

table = {'RRR':3,'RRS':2,'RSR':1,'RSS':1,'SRS':1,'SRR':2,'SSS':0,'SSR':1}

for key,value in table.items():
    if key==s:
        print(value)

Submission status: Accepted

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

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

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] == "S")or(s[0] == "S" and 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)

Submission status: Accepted

Solution code:
def resolve():
	S = input()
	mark = ""
	count = 0
	max_count = 0
	for s in list(S):
		if s == "R":
			count += 1
		else:
			max_count = max(max_count, count)
			count = 0
			mark = s
	max_count = max(max_count, count)
	print(max_count)
resolve()

Submission status: Accepted

Solution code:
S = input()
p = 0
q = 0
for i in range(len(S)):
    if S[i] != 'S':
        p += 1
        if p > q:
            q = p
    else:
      	p = 0
print(q)

Submission status: Accepted

Solution code:
x, y, z = input()
a = 0
if x == 'R':
  a += 1
  if y == 'R':
    a += 1
    if z == 'R':
      a += 1
else:
  if y == 'R':
    a += 1
    if z == 'R':
      a += 1
  else:
    if z == 'R':
      a += 1
print(a)

Submission status: Accepted

Solution code:
import re

X = input()

if re.search("RRR", X) != None:
  print("3")
elif re.search("RR", X) != None:
  print("2")
elif re.search("R", X) != None:
  print("1")
else:
  print("0")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import collections
from decimal import Decimal # 10進数で考慮できる

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

S = str(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:
s = str(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" or s[2] == "R":
        print(1)
    elif s[0] != "R" and s[2] != "R":
        print(0)

Submission status: Accepted

Solution code:
def Qa():
    s = input()
    ans = 0
    for v in s:
        if v == 'R':
            ans += 1
        elif ans == 0 and v == 'S':
            continue
        else:
            break
    print(ans)


if __name__ == '__main__':
    Qa()

Submission status: Accepted

Solution code:
def rain(S):
	i = 0
	while(i<3 and S[i]!='R'):
	  i+=1

	if(i==3):
		return 0

	j = i+1
	while(j<3 and S[j]=='R'):
	  j+=1

	return j-i

S = input()
print(rain(S))

Submission status: Accepted

Solution code:

S = input()

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

Submission status: Accepted

Solution code:
h=input()
fin=0
if h=='SSS':
  fin=0
elif h=='SRR'or h=='RRS':
  fin=2
elif h=='RRR':
  fin=3
else:
  fin=1

print(fin)

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3
 
def main():
    string = input()
    count = 0
    maxv = -1
    for s in string:
        if s == "R":
            count = count + 1
        else:
            maxv = max(count, maxv)
            count = 0
    maxv = max(count, maxv)
    print(maxv)
 
main()

Submission status: Accepted

Solution code:
a,b,c = map(str,input().rstrip(""))


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

print(count)

Submission status: Accepted

Solution code:
a=str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

m=0
for i in range(3):
  if s[i]=="S":
    continue
  j=i
  while j<3 and s[j]=="R":
    j+=1
  m=max(m,j-i)
print(m)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
emp = 0
l = a.split('S')
while("" in l):
   l.remove("")
if not l:
   print(emp)
else:
   print(len(l[0]))

Submission status: Accepted

Solution code:
a = str(input())
b = list(a)
if b == ["S","S","S"]:
  print(0)
elif b == ["R", "S", "R"]:
  print(1)
elif b ==["R", "S", "S"]:
  print(1)
elif b == ["S","R","S"]:
  print(1)
elif b == ["S","S","R"]:
  print(1)
elif b == ["R","R","S"]:
  print(2)
elif b == ["S","R","R"]:
  print(2)
else:
  print(3)

Submission status: Accepted

Solution code:
L=input()
x=int(0)
if (L in 'RRR'):
 x+=3
if (L in 'RRS'):
 x+=2
if (L in 'SRR'):
 x+=2
if (L in 'RSS'):
 x+=1
if (L in 'SRS'):
 x+=1
if (L in 'SSR'):
 x+=1
if (L in 'RSR'):
 x+=1
print(x)

Submission status: Accepted

Solution code:
s=list(input())
if s == ['R', 'S', 'R']:
  print(1)
  exit()
print(s.count('R'))

Submission status: Accepted

Solution code:
s = input().strip()
best = 0
streak = 0
for c in s:
    if c == 'R':
        streak += 1
        best =  max(best, streak)
    else:
        streak = 0
print(best)

Submission status: Accepted

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


abc175a_rainy_season()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input(str())
if S.count("R")==3:
 print (3)
elif S.count("R")==2:
 if S[1]=="R":
  print (2)
 else:
  print(1)
elif S.count("R")==1:
 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+=1
if ans==2:
    if S[0]!=S[1] and S[1]!=S[2]:
        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()
c=0
ans=0
for i in range(len(s)):
  	if(s[i]=='R'):
  		c+=1
  	else:
  		ans=max(ans,c)
  		c=0
if(c):    
  	ans=max(ans,c)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
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()
R = S.count('R')
print("1" if R == 2 and S[1] == "S" else R)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def RainySeason():
    
    str1 = str(input())

    if str1 == 'RRR':
        print(3)
        
    elif str1 == 'SSS':
        print(0)
        
    elif str1[:2] == 'RR' or str1[1:] == 'RR':
        print(2)
    
    else:
        print(1)

if __name__ == '__main__':
    RainySeason()

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict, deque
from copy import deepcopy
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
def end_of_loop():raise StopIteration
    
    
def main():
    temp = input().rstrip()
    result = 0
    result2 = 0
    for i in range(3):
        if temp[i] == "R":
            result+=1
        else:
            result2 = max(result2, result)
            result=0
    result2 = max(result2, result)
    print(result2)
if __name__ == "__main__":
    main()

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:
def INT():
    return int(input())

def MI():
    return map(int, input().split())

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

S = input()
ans = int(S[0] == "R" and S[1] == "R") + int(S[2] == "R" and S[1] == "R") + 1
print(ans if "R" in S else 0)

Submission status: Accepted

Solution code:
a = input()
continuous = 0


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

Submission status: Accepted

Solution code:
s = input()

ans = 1
check = False

if "R" in s:
    check = True

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

if check:
    print(ans)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
k=s.count('R')
ctr=0
for i in range(2):
  if s[i]==s[i+1]:
    ctr+=1
if k==ctr+1:
  print(k)
elif k!=0:
  print(1)
elif k==0:
  print(0)

Submission status: Accepted

Solution code:
s = input()
def solve(s):
    c = s.count('R')
    if c in [0, 1, 3]:
        return c
    elif s.count('RR') == 1:
        return 2
    else:
        return 1
print(solve(s))

Submission status: Accepted

Solution code:
S=str(input())

count=0
maxcount=0
flg=True
for i in range(3):
  ##print(i)
  ##print(S[i:i+1])
  ##print(count)
  if S[i:i+1]=='R':
    if i>0 and S[i-1:i]=='R':
      count+=1
    else:
      count=1
print(str(count))

Submission status: Accepted

Solution code:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file = 1





    
def solve():


    
    # for _ in range(ii()):

        
    ans = 0
    s = si()
    c = 0
    for i in s:
        if i=='S':
            ans = max(ans,c)
            c = 0
        else:
            c+=1
    ans = max(ans,c)
    print(ans)











        
if __name__ =="__main__":

    if(file):

        if path.exists('input.txt'):
            sys.stdin=open('input.txt', 'r')
            sys.stdout=open('output.txt','w')
        else:
            input=sys.stdin.readline
    solve()

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
S = str(input())


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


# 2darray [[0] * 4 for i in range(3)]
# import itertools

Submission status: Accepted

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

S = input()
count = 0
max_days = 0

for x in S:
    if x == 'S':
        count = 0

    if x == 'R':
        count += 1
        if count > max_days:
            max_days = count

print(max_days)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
data = input()
weathers = {"RRR":3, "RRS":2,"RSR":1,"RSS":1,"SRR":2,"SRS":1,"SSR":1,"SSS":0}

print(weathers[data])

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import re

pattern = re.compile("R+")
try:
    print(len(re.search(pattern, input()).group(0)))
except AttributeError:
    print(0)

Submission status: Accepted

Solution code:
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def main():
    S = ns()
    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)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = input()
B = A.count("R")
if A == "RSR":
    print(1)
else:
    print(B)

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

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:
# coding: utf-8
# Your code here!

s=input()

if "RRR"==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()

sc = s.count('S')


if sc == 0:
    print(3)
if sc == 2:
    print(1)
if sc == 3:
    print(0)

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

Submission status: Accepted

Solution code:
n = input()

num = n.count("R")

if num == 2 and n[0] != n[2]:
  print(num)
elif num == 2 and n[0] == n[2]:
  print(1)
else:
  print(num)

Submission status: Accepted

Solution code:
S=input()
s=S.split('S')
ans=0
for i in s:
    ans=max(ans,len(i))
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# A - Rainy Season
def main():
    s = list(input())
    cnt = 0

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


if __name__ ==  "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
r = 0
x=0
for i in s:
  if i == 'R':
    r += 1
  else:
    x = max(r,x)
    r = 0
print(max(x,r))

Submission status: Accepted

Solution code:
s=input()

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
arr = list(S)
count = 0
max = 0
for a in arr:
    if(a == 'R'):
        count += 1
        if(count > max):
            max = count
    else:
        count = 0
        
print(max)

Submission status: Accepted

Solution code:
x = input()

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

Submission status: Accepted

Solution code:
S = input()
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=list(map(str,input()))

count=0
ans=0
for i in N:
    if i=="R" and count>=1:
        count+=1
    elif i=="R" and count==0:
        count=1
    else:
        count=0
    ans=max(ans,count)
    
        
print(ans)

Submission status: Accepted

Solution code:
S=input()
count = 0
if S=="SSS":
    print(0)

if S=="RSS" or S=="RSR" or S=="SRS" or S=="SSR":
    print(1)

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

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

continuous_flag = True
res = 0
temp = 0
for s in S:
    if s == 'R':
        temp += 1
    else:
        res = max(res, temp)
        temp = 0
if temp >= 1:
    res = max(res, temp)
print(res)

Submission status: Accepted

Solution code:
k = input()

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

Submission status: Accepted

Solution code:
S = input()
if S == "RRR":
    print(3)
elif S == "RRS" or S == "SRR":
    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()
R_list = s.split('S')

ans = 0

for s in R_list:
  if ans < len(s):
    ans = len(s)
    
print(ans)

Submission status: Accepted

Solution code:
R = input()

rain_count = 0
reset = False
max_count = 0

for i in range(len(R)):
  if R[i] == "R":
    rain_count += 1
  else:
    reset = True
  
    if reset:
      max_count = max(max_count, rain_count)
      rain_count = 0

print(max(rain_count, max_count))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = list(input())
c = ""
a = 0
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:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def exit(*argv, **kwarg):
    print(*argv, **kwarg)
    sys.exit()


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def a_int(): return int(read())


def ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce

S = input()
ans = S.count('R')
if ans == 0:
    exit(0)

if S[1] == 'S':
    ans = 1
print(ans)