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()
cnt = 0
l =[]
for i in range(3):
    if s[i] == "R":
        cnt += 1
    else:
        l.append(cnt)
        cnt = 0

l.append(cnt)

print(max(l))

Submission status: Accepted

Solution code:
s = input()
if(s =="RRS")or(s =="SRR"):
    print(2)
elif(s =="RRR"):
    print(3)
elif(s =="SSS"):
    print(0)
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:
def f(s):
    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') or (s[1] == s[2] == 'R'):
        print(2)
    elif (s[0] == s[2] == 'R'):
        print(1)
    else:
        print(1)

s = input()
f(s)

Submission status: Accepted

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


def next_line():
    return input()


def next_int():
    return int(input())


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


def next_int_array_multi_lines(size):
    return [int(input()) for _ in range(size)]


def next_str_array(size):
    return [input() for _ in range(size)]


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
if S == 'RRR':
    print(3)
elif  S == 'SSS':
    print(0)
elif S in ['RRS', 'SRR']:
    print(2)
else:
    print(1)

Submission status: Accepted

Solution code:
s = input()
c = 0
m = 0
for i in s:
  if i == 'R':
    c += 1
  else:
    if m < c:
      m = c
    c = 0
print(m if m > c else c)

Submission status: Accepted

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

for i in S:
    if i == "R":
        count += 1


if count == 2:
    if S[1] == "S":
        ans = 1
    else:
        ans = 2
else:
    ans = count

print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
################################################

S = input()
c = 0
b = False

for s in S:
    if s == 'R':
        c += 1
        b = True
    else:
        if b:
            break

print(c)

Submission status: Accepted

Solution code:
S = list(input())
max = 0
curr = 0

for s in S:
  if s == "R":
    curr += 1
    if curr > max:
      max = curr
  if s == "S":
    curr = 0

print(max)

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

Submission status: Accepted

Solution code:
weather = input().rstrip()
#print(weather)

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

Submission status: Accepted

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

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:
S = input()
counter = 0
tmp = 0
for s in S:
    if s == 'R':
        counter += 1
        tmp = counter
    else:
        counter = 0
print(tmp)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()
ans = 0
list_ans=[]
flag = 0
for i in range(len(str)):
    if str[i] == 'R':
        if flag == 0:
            ans = 1
        else:
            ans += 1
        flag = 1
    else:
        flag = 0
        list_ans.append(ans)
list_ans.append(ans)
print(max(list_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:
line = list(input())
count = 0
if line[0] == "R":
  if line[1] == "R":
    if line[2] == "R":
      count = 3
    else:
      count = 2
  else:
    count = 1
elif line[1] == "R":
  if line[2] == "R":
    count = 2
  else:
    count = 1
elif line[2] == "R":
  count = 1
print(str(count))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = input()
rainy_count = 0
max_rainy_count = 0

for i in range(3):
  if weather[i] == "R":
    rainy_count += 1
    if max_rainy_count < rainy_count:
        max_rainy_count = rainy_count
    
  else:
    rainy_count = 0
            
print(max_rainy_count)

Submission status: Accepted

Solution code:
S = input()

if S.count("RRR") == 1:
    print(3)
elif S.count("RR") == 1:
    print(2)
elif S.count("R") != 0:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
inp =input()
count=0 
res=0 
for ch in inp: 
  if ch=="R": 
    count+=1 
    res = max(res,count) 
  else: 
    res=max(res,count) 
    count=0 
print(res)

Submission status: Accepted

Solution code:
S = str(input())

if S.count("RRR") == 1:
  print(3)
elif S.count("RR") == 1:
  print(2)
elif S.count("R") != 0:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
print(max(map(lambda x: len(x), input().split('S'))))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
t = input()
if (abs(len(t))<=3) and (t in 'S' or 'R'):
    if t[0]=='R' and t[1]=='R' and t[2]=='R':
        print(3)
    elif (t[0]=='R' and t[1]=='R' and t[2]!='R') or (t[0]!='R' and t[1]=='R' and t[2]=='R'):
        print(2)
    elif t[0]!='R' and t[1]!='R' and t[2]!='R':
        print(0)
    else:
        print(1)
else:
    print('false')

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:
def main():
    s: str = input()

    counter: int = 0
    res: int = 0

    for w in s:
        if w == 'R':
            counter += 1
            if counter > res:
                res = counter
        else:
            counter = 0

    print(res)

if __name__ == '__main__':
    main()

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

cnt = 0

for i in range(len(S)):
  if S[i] == 'R':
    if cnt == 0:
      cnt += 1
    elif S[i - 1] == 'R':
      cnt += 1

print(cnt)

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 == 'RRR':
    print(3)
elif S in ('RRS', 'SRR'):
    print(2)
elif S == 'SSS':
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
s = list(input())
result = 0
answer = 0

for i in range(len(s)):
	if s[i] == "R":
		result += 1
	else:
		result = 0
	if result > answer:
		answer = result

print(answer)

Submission status: Accepted

Solution code:
def main():
  s = list(input())
  ans = 0
  ansma = 0
  for i in s:
    if i == "R":
      ans += 1
    else:
      ans = 0
    if ans >= ansma:
      ansma = ans
  print(ansma)
  
if __name__ == "__main__":
  main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
p_str=list(input())
#print(p_str)

cnt=0
maxcnt=0
for A in p_str:
  if A=='R':
    cnt+=1
  else:
    cnt=0
  if maxcnt < cnt:
    maxcnt=cnt
    
print(maxcnt)

Submission status: Accepted

Solution code:
S = input().strip()

ans = 0
counter = 0
for s in S:
    if s == 'S':
        ans = max([ans, counter])
        counter = 0
    else:
        counter += 1
else:
    ans = max([ans, counter])
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()

n_rainy_day = 0

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

Submission status: Accepted

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

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:
data=input()
ans=0
temp=0
for i in range(len(data)):
    if data[i]=="S":
        temp=0
    else:
        temp+=1
    if ans<=temp:
        ans=temp
print(ans)

Submission status: Accepted

Solution code:
import math

n=0
result=0
k=input()

for i in range(len(k)):
    if k[i]=="R":
        n+=1
    else:
        result=max(result,n)
        n=0
result=max(result,n)
print(result)

Submission status: Accepted

Solution code:
s = str(input())
if s.count("RRR") == 1:
    print("3")
elif s.count("RR") == 1:
    print("2")
elif s.count("R") >= 1:
    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":
	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:
D = list(input())

C = 0
c = 0
for d in D :
  if d == 'R':
    c += 1
    if c > C :
      C = c
  else : 
    c = 0
    
print(C)

Submission status: Accepted

Solution code:
S = list(input())
T = []
cnt = 0
for i in range(len(S)):
  if S[i]=='R':
    T.append(1)
  else:
    T.append(0)
result = int("".join(str(i) for i in T),2)
if(result==0):
  cnt=0
elif ((result==6) or (result==3)):
  cnt = 2
elif (result==7):
  cnt = 3
else:
  cnt = 1
print(cnt)

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":
    if S[1]=="R":
        ans += 1
    elif S[0]=="S":
        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 = list(input())
ans = 0
i = 0

if(S[i] == 'R'):
    ans+=1
    i+=1
    if(S[i]=='R'):
        ans+=1
        i+=1
        if(S[i]=='R'):
            ans+=1
elif(S[i+1]=='R'):
    ans+=1
    i+=1
    if(S[i+1]=='R'):
        ans+=1
elif(S[i+2]=='R'):
    ans+=1
        
print(ans)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
s=input()
l=list(s)
m=l.count("R")
if m==0:
  print(0)
elif m==1:
  print(1)
elif m==3:
  print(3)
else:
  if l[1]=="S":
    print(1)
  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:
we=input()
if we=="RRR":
  print(3)
elif we=="RRS" or we=="SRR":
  print(2)
elif we=="SSS":
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
day = input()
resMax = 0
resTemp = 0
for i in range(len(day)):
  if day[i]=='S':
    resTemp=0
  elif day[i]=='R':
    resTemp=0
    while (i<len(day)) and (day[i]!='S'):
      resTemp+=1
      i+=1
    if resTemp>resMax:
      resMax=resTemp
print(resMax)

Submission status: Accepted

Solution code:
S = input()

if S == 'RRR':
    print(3)
elif S[:2] == 'RR' or S[1:] == 'RR':
    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 S == "SSS":
    print(0)
elif S == "SSR":
    print(1)
elif S == "SRS":
    print(1)
elif S == "SRR":
    print(2)
elif S == "RSS":
    print(1)
elif S == "RSR":
    print(1)
elif S == "RRS":
    print(2)
elif S == "RRR":
    print(3)

Submission status: Accepted

Solution code:
n = input().rstrip()
count = 0
max = 0
for i in range(len(n)):
    if n[i] == "R":
        count += 1
        if max < count:
            max = count
    else:
        count = 0

print(max)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


def solve():
    if "RRR" in weather:
        return 3
    elif "RR" in weather:
        return 2
    elif "R" in weather:
        return 1
    else:
        return 0
if __name__ == "__main__":
    weather = input().rstrip()
    print(solve())

Submission status: Accepted

Solution code:
S = input()

row_now = 0
row_max = 0
for day in S:
    if day == "R":
        row_now += 1
    else:
        row_now = 0
    if row_now > row_max:
        row_max = row_now

print(row_max)

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

def input(): return sys.stdin.readline().rstrip("\r\n")
def List(): return list(map(int, input().split()))
def Num(): return int(input())


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:
  c=3
elif 'RR' in s:
  c=2
elif 'R' in s:
  c=1
else:
  c=0
print(c)

Submission status: Accepted

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

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 "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:
r,s=0,input()
for l in s:
  if l=='S' and r>0:
    break
  r+=1 if l=='R' else 0
print(r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lst = list(input().upper())
max_count = 0
if "R" in lst:
    slicedList = lst[lst.index("R")+1:]
    
    counter = 0
    for i in lst:
        if i == "R":
            counter += 1
            if counter > max_count:
                max_count = counter
        else:
            counter = 0
                
print(max_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
t = list(input())
if t[1] == 'S':
  if t.count('R')>0:
  	print(1)
  else:
    print(0)
else:
  print(t.count('R'))

Submission status: Accepted

Solution code:
S = input()
max_count = 0
counter = 0
for i in S:
  if i == 'S':
    if max_count < counter:
      max_count = counter
      counter = 0
  elif i == 'R':
    counter += 1

if max_count < counter:
  max_count = counter

print(max_count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()

    # See:
    # https://atcoder.jp/contests/abc175/submissions/15907467
    # Pythonのシンタックスを活用
    if 'RRR' in s:
        print(3)
    elif 'RR' in s:
        print(2)
    elif 'R' in s:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    s = input()

    # See:
    # https://atcoder.jp/contests/abc175/editorial/51
    # 1. 各文字がRと一致しているか
    # 2. 何文字一致しているか、を条件分岐
    first = s[0] == 'R'
    second = s[1] == 'R'
    third = s[2] == 'R'

    if first and second and third:
        print(3)
    elif (first and second) or (second and third):
        print(2)
    elif (first or second or third):
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    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 == 'RSR':
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
num=0
a=[0]
for i in s:
    if i=="R":
        num+=1
        a.append(num)
    else:
        num=0
print(max(a))

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    S = input().strip()
    if 'RRR' in S:
        print(3)
    elif 'RR' in S:
        print(2)
    elif 'R' in S:
        print(1)
    else:
        print(0)

if __name__ == '__main__':
    main()

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:
W = input()
len = W.count('R')

if len != 2:
    print(len)
elif W[1] == 'R':
    print(2)
else:
    print(1)

Submission status: Accepted

Solution code:
s = input()

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

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

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

if __name__ == "__main__":
    print(rain(S))

Submission status: Accepted

Solution code:
import sys
S = str(input())

cnt = 0
ans = 0

for c in S:
    if c == 'R':
        cnt = cnt + 1
    else:
        cnt=0
    ans=max(ans,cnt)

print(ans)

Submission status: Accepted

Solution code:
import math
from functools import reduce
from collections import deque
import sys
sys.setrecursionlimit(10**7)

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

# スペース区切りの入力を読み込んで数値リストにして返します。
def get_nums_l():
    return [ int(s) for s in input().split(" ")]

# 改行またはスペース区切りの入力をすべて読み込んでイテレータを返します。
def get_all_int():
    return map(int, open(0).read().split())

def log(*args):
    print("DEBUG:", *args, file=sys.stderr)

def main():
    INF = 999999999999999999999999
    MOD = 10**9+7

    s = input()

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

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

count = 0
rain_counter = 0
L = []
for s in S:
    if s == "R":
        rain_counter += 1
    if s == "S":
        L.append(rain_counter)
        rain_counter = 0
    count += 1
    if count == len(S):
        L.append(rain_counter)

print(max(L))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
t=s.find('R')
if t==2:
    print(1)
elif t==-1:
    print('0')
elif t==0:
    if s[t]==s[t+1]:
        if s[t+1]==s[t+2]:
            print('3')
        else:
            print('2')
    else:
        print(1)
else:
    if s[t]==s[t+1]:
        print(2)
    else:
        print(1)

Submission status: Accepted

Solution code:
s = input()

if s == 'RSR':
    print(1)
    exit()

ans = 0

for i in s:
    if i == 'R':
        ans += 1

print(ans)

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:
s=input()
count=0
i=0
while i<len(s):
    summ=0
    while i<len(s) and s[i]=='R':
        summ+=1
        i+=1
    if summ>count:
        count=summ
    i+=1


print(count)

Submission status: Accepted

Solution code:
x = input()

ans = 0
if x == 'SSS':
    print(0)

elif x == 'RRR':
    print(3)
    
elif x=='RRS' or x=='SRR':
    print(2)
    
else:
    print(1)

Submission status: Accepted

Solution code:
s = input()
ans = 0

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

elif s[1] == 'R':
    if s[2] == 'R':
        ans = 2
    else:
        ans =1

elif s[2] == 'R':
    ans = 1

print(ans)

Submission status: Accepted

Solution code:

    


import collections
if __name__=='__main__':
    s  = input()
    maxs = 0
    r = 0
    for i in s:
        if i == 'R':
            r+=1
        else:
            r = 0
        maxs = max(maxs,r)
    print(maxs)

Submission status: Accepted

Solution code:
S = input()

cur_l, max_l = 0, 0

for s in S:
  if s == 'R':
    cur_l += 1
  else: # s == 'R'
    if cur_l > max_l:
      max_l = cur_l
    cur_l = 0

if cur_l > max_l:
  max_l = cur_l

print(max_l)

Submission status: Accepted

Solution code:
import sys
from collections import Counter


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


s = S()

if s == 'RRR':
    ans = 3
elif s[:2] == 'RR' or s[1:] == 'RR':
    ans = 2
else:
    c = Counter(list(s))
    if c['R'] == 1:
        ans = 1
    elif c['S'] == 3:
        ans = 0
    else:
        ans = 1

print(ans)

Submission status: Accepted

Solution code:
S = str(input())

c = 0
d = 0

for i in range(len(S)):
  if S[i] == 'R':
    d += 1
    if c <= d:
      c = d
  else:
    d = 0

print(c)

Submission status: Accepted

Solution code:
S=str(input())
if S[0]=="R" and S[1]=="S":
    print(1)
    
else:
    print(S.count("R"))

Submission status: Accepted

Solution code:
tenki=str(input())

if "RRR" in tenki:
  print(3)

elif "RR" in tenki and "RRR" not in tenki:
  print(2)
elif "RR" not in tenki and "SSS" not in tenki:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
S=input()
p=S[0]
q=S[1]
r=S[2]

if p == 'R' and q=='R' and r=='R':
    print(3)
elif (p=='R' and q=='R') or  (q=='R' and r=='R') :
    print(2)
elif p=='R'or q=='R' or r=='R':
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-


def main():
    S = input().split('S')

    print(max([len(s) for s in S]))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

s = str(input())
ans = 0
tmp = 0
cons = False
for i in range(len(s)):
    if(s[i]=='R'):
        tmp+=1
    else:
        ans = max(ans, tmp)
        tmp = 0
if(tmp):
    ans= max(tmp, ans)
print(ans)

Submission status: Accepted

Solution code:
S = input()
s_num = len(S)

i=0
max_count = 0
count = 0

while i < s_num:
    if S[i] != "R":
        if max_count < count:
            max_count = count
            count = 0
    elif S[i] == "R":
        count += 1

    i+=1

if max_count < count:
    max_count = count

print(max_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import sys
from itertools import chain

# import numpy as np


def solve(S: str):
    answer = max(list(map(len, S.split("S"))))
    return answer


def main():
    S = input()  # type: str
    print(solve(S))


if __name__ == "__main__":
    main()

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 S[0] == 'R':
  if S[1] == 'R':
    if S[2] == 'R':
      #RRR
      print('3')
    else:
      #RRS
      print('2')
  else:
    #RSR or RSS
    print('1')
else:
  if S[1] == 'R':
    if S[2] == 'R':
      #SRR
      print('2')
    else:
      #SRS
      print('1')
  else:
    if S[2] == 'R':
      #SSR
      print('1')
    else:
      print('0')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
a=0
for i in range(3):
  if a==0:
    if s[i]=="R":
      a+=1
  else:
    if s[i-1]=="R" and s[i]=="R":
      a+=1

print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
max = 0
j = 0
for i in range(3):
    if S[i] == 'R':
        j += 1
        if max < j:
            max = j
    if S[i] == 'S':
        j = 0

print(max)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()
answers = [0]
ans = 0
i = 0
while i <= 2:
  if S[i] == 'R':
    ans += 1
  else:
    answers.append(ans)
    ans = 0
  i += 1

answers.append(ans)

print(max(answers))

Submission status: Accepted

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

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:
str =list(input())
counter =0
max=0
for s in str:
    if s =='S':
        counter =0
    else :
       counter +=1
       if max <counter:
          max =counter
print(max)

Submission status: Accepted

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

Submission status: Accepted

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