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=str(input())
count=0
res=0
for i in range(3):
    if s[i]=="R":
        count+=1
        res=count
    else:
        count=0

print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str1=input()
ct=0
for i in range(0,3):
    if(str1[i]=='S'):
        ct+=1
if(ct==0):
    print(3)
if(ct==3):
    print(0)
if(ct==2):
    print(1)
if(ct==1):
    if(str1[1]=='S'):
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
S = list(input())

ans = 0
temp = 0
for i in S:
    if i == "R":
        temp += 1
    else:
        temp = 0
    ans = max(ans,temp)
        
print(ans)

Submission status: Accepted

Solution code:
# input 長さ3の文字列
input_s = input();

output = 0;

if "R" in input_s:
    output = 1;

if "RR" in input_s:
    output = 2;

if "RRR" in input_s:
    output = 3;

print(output);

Submission status: Accepted

Solution code:
S=input()

if S.count("R")==2:
    if S.count("RR")==1:
        print(2)
    else:
        print(1)
    
else:
    print(S.count("R"))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = list(input())
x = 3
ans = 0
if 'R' in a:
    x = a.index('R')
for i in range(x, 3):
    if a[i] == 'R':
        ans += 1
    else:
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
string=input()

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

Submission status: Accepted

Solution code:
s = input()
if(s=='RRR'):
  ans = 3
elif(s[0:2]=='RR' or s[1:3]=='RR'):
  ans = 2
elif(s[0]=='R' or s[1]=='R' or s[2]=='R'):
  ans = 1
else:
  ans = 0

print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = read().rstrip().decode()

def solve(x):
    if x.count('RRR'):
        return 3
    if x.count('RR'):
        return 2
    if x.count('R'):
        return 1
    return 0

print(solve(x))

Submission status: Accepted

Solution code:
s = str(input())

n = len(s)
c = 0

for i in range(n):
    if s[i] == "R":
        j = i
        a = 0
        while s[j] == "R" and j < n-1:
            a += 1
            j += 1
        if j == n-1 and s[j] == "R":
            a += 1
        c = max(a,c)

print(c)

Submission status: Accepted

Solution code:
tenki = list(input())
ans = 0
max_ans = 0
for i in tenki:
  if i == "R":
    ans = ans + 1
    flag = 0
  else:
    flag = 1
  if flag == 1:
    if max_ans < ans:
      max_ans = ans
    ans = 0
if max_ans > ans:
  print(max_ans)
else:
  print(ans)

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()
S=list(S)
c=0
max=0
for i in S:
    if i=="R":
        c+=1
    else:
        if max<c:
            max=c
            c=0

if max<c:
    max=c
    c=0

print(max)

Submission status: Accepted

Solution code:
w=input()
count=0

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

Submission status: Accepted

Solution code:

a=input().split("S")
cnt=0
for i in a:
  cnt=max(cnt, len(i))
print(cnt)

Submission status: Accepted

Solution code:
""" A
    https://atcoder.jp/contests/abc175/tasks/abc175_a
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return [lambda _: readIntegerSet(m) for _ in range(0, n)]

def main(S):
    candidate = 0
    best = 0

    for c in list(S.rstrip()):
        if c == "S":
            if candidate > best:
                best = candidate
            candidate = 0
        else:
            candidate += 1

    if candidate > best:
        best = candidate

    return best

if __name__ == "__main__":
    _S = readString()

    print(main(_S))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import io, sys

def main():
    S = sys.stdin.readline().rstrip()
    
    prev = ""
    cnt = 0
    cnt_max = 0

    for char in S:
        if char == "R":
            cnt += 1
        elif char == "S":
            cnt = 0
        
        cnt_max = max(cnt_max, cnt)
    
    print(cnt_max)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = S.count("R")
if S[1] == "R":
  print(n)
elif n >= 1:
  print(1)
else:
  print(n)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = str(input())

count = 0
if S[0] == 'R':
    count += 1
    if S[1] == 'R':
        count += 1
        if S[2] == 'R':
            count += 1
elif S[1] == 'R':
    count += 1
    if S[2] == 'R':
        count += 1
elif S[2] == 'R':
    count += 1

print(count)

Submission status: Accepted

Solution code:

A = input()
total = 0
for i in range(3):
    if A[0] == "R" and A[1] == "R" and A[2] == "R":
        total = 3
    elif A[0] == "R" and A[1] == "R" and A[2] == "S":
        total = 2
    elif A[0] == "R" and A[1] == "S" and A[2] == "R":
        total = 1
    elif A[0] == "S" and A[1] == "R" and A[2] == "R":
        total = 2
    elif A[0] == "S" and A[1] == "S" and A[2] == "R":
        total = 1
    elif A[0] == "S" and A[1] == "R" and A[2] == "S":
        total = 1
    elif A[0] == "R" and A[1] == "S" and A[2] == "S":
        total = 1
    elif A[0] == "S" and A[1] == "S" and A[2] == "S":
        total = 0

print(total)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

r3=s.count('RRR')
if r3==1:
    print(3)
    exit(0)
r2=s.count('RR')

if r2==1:
    print(2)
    exit(0)

r=s.count('R')

if r>=1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    s = rs()
    ans = 3 if "RRR" in s else 2 if "RR" in s else 1 if "R" in s else 0
    print(ans)

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()
cnt = 0
if S == 'RRR':
    cnt = 3
elif S == 'RRS' or S == 'SRR':
    cnt = 2
elif 'R' in S:
    cnt = 1
else:
    cnt = 0
# for i in range(len(S)):
#     if(S[i] == 'R'):
#         cnt += 1
#     else:
#         cnt = 0
print(cnt)

Submission status: Accepted

Solution code:
w = input()

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

Submission status: Accepted

Solution code:
s = input()
num = 0
num2 = 0
for i in range (3) :
#  print(s[i])

  yesterday = 'R'
  if s[i] == 'R':
    if yesterday == 'R':
      num2 += 1
    else :
      yesterday = 'R'
  else :
    yesterday = 'S'
    if num2 > num:
      num = num2
      num2 = 0


if num2 > num:
  num = num2


print(num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

flag = 0
max_ = 0
for i in S:  
    if i == "R":
        flag += 1
    else:
        flag = 0
    if flag > max_:
        max_  = flag

print(max_)

Submission status: Accepted

Solution code:
T = input()
ans = 0
cur = 0
for i in T:
    if i=="R":
        cur += 1
    else:
        cur = 0
    ans = max(ans,cur)
print(ans)

Submission status: Accepted

Solution code:
data = list(input())
count = 0
for i in data:
  if(i=='R'):
    count+=1
    
if (count ==2 and data[1]=='S'):
	count =1
    
print(count)

Submission status: Accepted

Solution code:
S = input()

ans = 0
if S == "SSS":
    ans = 0
elif S in ["RSS", "SRS", "SSR", "RSR"]:
    ans = 1
elif S in ["RRS", "SRR"]:
    ans = 2
elif S == "RRR":
    ans = 3

print(ans)

Submission status: Accepted

Solution code:
weather = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
tenki = input()

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

Submission status: Accepted

Solution code:
S=input()
bef = S[0]
result = 0
result_lst=[]
if bef == "R":
    result = 1


for i in range(1,3):
    if S[i] == "R":
        result +=1
    else:
        result_lst.append(result)
        result=0
result_lst.append(result)
print(max(result_lst))

Submission status: Accepted

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

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:
S = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
        
    else:
        count = 0
    if count > ans:
        ans = count
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
S = input()

# 求解処理
ans = S.count("R") - (S == "RSR")

# 結果出力
print(ans)

Submission status: Accepted

Solution code:
s = str(input())

n = s.count('R')

if n == 0:
    print(0)
else:
    if n == 1:
        print(1)
    else:
        m = s.count('RR')
        if m == 0:
            print(1)
        elif m == 1:
            l = s.count('RRR')
            if l == 1:
                print(3)
            else:
                print(2)

Submission status: Accepted

Solution code:
x = input()
t = x.count("R")
if t != 3 and x[0] == x[2] and x[0] == "R":
  t -= 1
print(t)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 17:00:46 2020

@author: saito
"""

# %% import phase

# %% define phase
# %% input phase
s = input()

# %% process phase
ans = 0
cnt = 0
for i in s:
    if i == 'R':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans,cnt)

# %%output phase
print(ans)

Submission status: Accepted

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

if __name__ == "__main__":
  s = list(input())
  sum = 0
  for i in range(3):
    if s[i] == 'R':
      sum = 1
  if s[0] == 'R' and s[1] =='R':
    sum += 1
  if s[1] == 'R' and s[2] == 'R':
    sum += 1
  print(sum)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    s = list(input())
    last = ''
    count = 0
    for i, day in enumerate(s):
        if day == 'S':
            last = day
            continue
        if i == 0:
            count += 1
        elif last == 'R':
            count += 1
        elif last == 'S':
            count = 1
        last = day

    print(count)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

def main():
    mod=10**9+7
    S=input()
    
    if "RRR" in S:
        print(3)
    elif "RR" in S:
        print(2)
    elif "R" in S:
        print(1)
    else:
        print(0)

main()

Submission status: Accepted

Solution code:
S=input()
c=0
c_max=0
for s in S:
  if s == "R":
    c+=1
  else:
    c=0
  if c>c_max:
    c_max=c
print(c_max)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S=input()
cnt=0

if S=="RSR":
    cnt+=1
else:
    for c in S:
        if c=='R':cnt+=1
    
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
R = str(input())

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

Submission status: Accepted

Solution code:
from sys import stdin

S = stdin.readline().rstrip()

count = 0
if S[0]=='R':
  if S[1] =='R':
    if S[2] =='R':
      count = 3
    else:
      count = 2
  else:
    if S[2] =='R':
      count = 1
    else:
      count = 1
else:
  if S[1] =='R':
    if S[2] =='R':
      count = 2
    else:
      count = 1
  else:
    if S[2] =='R':
      count = 1
    else:
      count = 0

print(count)

Submission status: Accepted

Solution code:
s = input()

ans = 0
t = 0
for c in s:
    if c == "R":
        t += 1
    else:
        ans = max(ans, t)
        t = 0
ans = max(ans, t)


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

cnt = 0

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

if S[1]=="R":
    cnt += 1
    if S[2]=="R":
        cnt += 1
else:
    if S[2]=="R":
        cnt = 1
    
    
print (cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

Rs = S.split("S")

count = 0
for r in Rs:
  if len(r) > count:
    count = len(r)
    
print(count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
str = input()

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

Submission status: Accepted

Solution code:
x = input()
count = 0
if x[0] == 'S':
    if x[1] == 'R':
        count+= 1
        if x[2] == 'R':
            count += 1
        if x[2] == 'S':
            count = count

    if x[1] == 'S':
        if x[2] == 'R':
            count += 1
        if x[2] == 'S':
            count = count

if x[0] == 'R':
    count += 1
    if x[1] == 'R':
        count+= 1
        if x[2] == 'R':
            count += 1
        if x[2] == 'S':
            count = count

    if x[1] == 'S':
        if x[2] == 'R':
            count = 1
        if x[2] == 'S':
            count = count

print(count)

Submission status: Accepted

Solution code:
S = input()
counts = []
count = 0
for x in S:
  if x == 'R':
    count += 1
  else:
    counts.append(count)
    count = 0
counts.append(count)
print(max(counts))

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

Submission status: Accepted

Solution code:
S = input()

ans = 0
tmp = ''
for i in range(len(S)):
    if S[i]=='R':
        tmp += '1'
    if S[i]=='S':
        tmp += '0'

if tmp == '111':
    print(3)
elif tmp == '110':
    print(2)
elif tmp == '101':
    print(1)
elif tmp == '011':
    print(2)
elif tmp == '100':
    print(1)
elif tmp == '010':
    print(1)       
elif tmp == '001':
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()
cnt = 0
R_max = 0
for mozi in s:
    if mozi == "R":
        cnt+= 1
    else:
        R_max = max(cnt,R_max)
        cnt = 0
R_max = max(cnt,R_max)
print(R_max)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
count = 0
flag = False
max = 0
for i in s:
    if i == 'R':
        if flag:
            count += 1
        else:
            count = 1
            flag = True
        if max < count:
            max = count
    else:
        flag = 0
print(count)

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:
import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

cnt=0
s=input().strip("\n")
for i in range(2):
    if s[i]=="R" and cnt==0:
        cnt+=1
    if s[i]==s[i+1]=="R":
        cnt+=1
if s[2]=="R" and cnt==0:
    cnt+=1
print(cnt)

Submission status: Accepted

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

ans = max(c)
print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = 0
for s in range(len(S)):
	if S[s]=="R":
		ans += 1

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def A(S):
    answer = 0

    if S[1] == 'R':
        answer += 1
        if S[0] == 'R':
            answer += 1
        if S[2] == 'R':
            answer += 1
    elif S[0] == 'R' or S[2] == 'R':
        answer = 1

    return answer

  
S = input()
print(A(S))

Submission status: Accepted

Solution code:
from collections import Counter
import copy
from itertools import combinations


def A(s):
  if s == 'RRR':
    return 3
  elif s == 'RRS':
    return 2
  elif s == 'RSR':
    return 1
  elif s == 'SRR':
    return 2
  elif s == 'RSS':
    return 1
  elif s == 'SRS':
    return 1
  elif s == 'SSR':
    return 1
  elif s == 'SSS':
    return 0
  l = 0
  max_l = 0
  for i in range(len(s)):
    if i == 0 and s[i] == 'R':
      l += 1
    elif s[i - 1] == s[i] and s[i] == 'R':
      l += 1
    else:
      l = 0
    if l > max_l:
      max_l = l
  return max_l


def B():
  pass


def C():
  pass


def main():
  s = input()
  print(A(s))


if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
s=input()
c=0
for j in range(len(s)):
    if(s[j]=='R'):
        while(j<3 and s[j]=='R'):
            c=c+1
            j=j+1
            
            
        break
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
counter = 0
C = []
for i in range(len(S)):
  if S[i] == "R":
    counter += 1
    C.append(counter)
  else:
    counter = 0

if C != []:
  print(max(C))
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
cnt = 0

for i in range(len(s)):
    if s[i] == 'R':
        if i > 0 and s[i-1] == 'R':
            cnt += 1
        else:
            cnt = 1
    else:
        cnt = 0
    ans = max(ans, cnt)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
flag = 1
ans = 0
tmp = 0

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

print(ans)

Submission status: Accepted

Solution code:
s=input()
arr=[]
for i in s:
    arr.append(i)
brr=[]
count=0
for i in arr:
    if(i=='S'):
        brr.append(count)
        count=0
    if(i=='R'):
        count=count+1 
brr.append(count)
print(max(brr))

Submission status: Accepted

Solution code:
S = input()
#N = int(input())
#A, B = map(int, input().split())
#List = list(map(int, input().split()))
 
if S=="RRR":
    print(3)
elif S=="RRS":
    print(2)
elif S=="SRR":
    print(2)
elif S=="SSS":
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
l=input().split("S")
out=0
for i in l:
    if len(i)>out:
        out=len(i)
print(out)

Submission status: Accepted

Solution code:
S = input()

K = S.count("R")

if K == 0:
    print(0)

elif K == 1:
    print(1)

elif K == 3:
    print(3)

elif K == 2:
    k2 = S.count("RR")
    if k2 == 0:
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
s = input()
print(s.count('R')-1 if s=='RSR' else 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:
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq
sys.setrecursionlimit(10**6)
# INF =  float("inf")
INF = 10**18
import bisect
import statistics
mod = 10**9+7
# mod = 998244353

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

Submission status: Accepted

Solution code:
S = input()
counts = [0]
if "R" in S:
  counts.append(1)
if "RR" in S:
  counts.append(2)
if "RRR" in S:
  counts.append(3)
print(max(counts))

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 == "SSS"):
  print("0")
elif (s == "SSR"):
  print("1")
elif (s == "SRS"):
  print("1")
elif (s == "RSS"):
  print("1")
elif (s == "SRR"):
  print("2")
elif (s == "RSR"):
  print("1")
elif (s == "RRS"):
  print("2")
else:
  print("3")

Submission status: Accepted

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

Submission status: Accepted

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

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

print(count)

Submission status: Accepted

Solution code:
w = input()
we = list(w)
count = 0
m_count = 0

for i in we:
    if i == "R":
        count += 1
    else:
        if count > m_count:
            m_count = count
        count = 0

if count > m_count:
    m_count = count
print(m_count)