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:
import re
s=input()

rs = [len(x) for x in re.findall("R{1,}", s)]

if rs == []:
    print(0)
else:
    print(max(rs))

Submission status: Accepted

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

    if S.find("RRR") > -1:
        print(3)
    elif S.find("RR") > -1:
        print(2)
    elif S.find("R") > -1:
        print(1)
    else:
        print(0)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s1, s2, s3 = str(input())
if s1 == "R":
  if s2 == "S":
    result = 1
  else:
    if s3 == "S":
      result = 2
    else:
      result = 3
else:
  if s2 == "S":
    if s3 == "S":
      result = 0
    else:
      result = 1
  else:
    if s3 == "S":
      result = 1
    else:
      result = 2

print(result)

Submission status: Accepted

Solution code:
import sys

def main():
    input = sys.stdin.readline
    s = input()
    if s[0] == "R":
        if s[1] == "R":
            if s[2] == "R":
                print(3)
            else:
                print(2)
        else:
            print(1)
    elif s[1] == "R":
        if s[2] == "R":
            print(2)
        else:
            print(1)
    elif s[2] == "R":
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

print(max_count)

Submission status: Accepted

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

if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
S = input()

count = S.count("R")

if (count == 3) or (count == 1) or (count == 0):
    print(count)
elif S != "RSR":
    print(count)
else:
    print(1)

Submission status: Accepted

Solution code:
s = input()
lists = list(s)
count = 0
saidai = 0

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

print(saidai)

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

Submission status: Accepted

Solution code:
import sys

data = sys.stdin.readline()
res = 0
if "R" == data[1]:
    if "R" == data[0]:
        if "R" == data[2]:
            res = 3
        else:
            res = 2
    else:
        if "R" == data[2]:
            res = 2
        else:
            res = 1
else:
    if "R" == data[0] or "R" == data[2]:
        res = 1

print(res)

Submission status: Accepted

Solution code:
def main():
    s = input()
    c = 0
    if s[0] == s[1] == s[2] == "R":
        print(3)
        return
    if s[0] == s[1] == "R" or s[1] == s[2] == "R":
        print(2)
        return
    if s[0] == s[1] == s[2] == "S":
        print(0)
        return

    print(1)
    return

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
x=input()

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

Submission status: Accepted

Solution code:
S = input()
r_num = 0
flag = True

for s in S:
    if s == 'R' and flag:
        r_num += 1
    elif s == 'R' and (flag == False):
        if r_num == 0:
            r_num += 1
        flag = True
    else:
        flag = False

print(r_num)

Submission status: Accepted

Solution code:
S = list(input())
count = 0
max_count = 0
for i in range(len(S)):
    a = S[i]
    if a == 'R':
       count += 1
    else:
       max_count = max(max_count, count)
       count = 0
max_count = max(max_count, count)
print(max_count)

Submission status: Accepted

Solution code:
S = list(input())

ans = 0
for i in S:
    if i == "R":
        ans += 1
    
if S[1] == "S" and S[2] == "R" and S[0] == "R":
    print(1)
elif ans == ans:
    print(ans)
else:
    print(0)

Submission status: Accepted

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

print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(str(input()))
#A=list(map(int,input().split()))
if s.count("R")==2:
    if s[1]=="R":
        print(2)
    else:
        print(1)
else:
    print(s.count("R"))

Submission status: Accepted

Solution code:
import sys,math
from collections import deque,defaultdict
import operator as op
from functools import reduce
sys.setrecursionlimit(10**6) 

I=sys.stdin.readline

 #s="abcdefghijklmnopqrstuvwxyz"

#
def ii():
	return int(I().strip())
def li():
	return list(map(int,I().strip().split()))
def mi():
	return map(int,I().strip().split())

def ncr(n, r):
    r = min(r, n-r)
    numer = reduce(op.mul, range(n, n-r, -1), 1)
    denom = reduce(op.mul, range(1, r+1), 1)
    return numer // denom

def gcd(x, y):
    while y:
        x, y = y, x % y
    return x





	

def main():
	s=I().strip()
	arr=s.split("S")
	ans=0
	for i in arr:
		ans=max(ans,len(i))
	print(ans)

	













	
	
	






		







		
		
	
		

	







		









if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
S=list(input())
n=0
x=0
for i in range(3):
    if S[i]=='R':
        n+=1
    else:
        if x<n:
            x=n
        n=0
if x!=0:
    print(x)
else:
    print(n)

Submission status: Accepted

Solution code:
s = list(input().strip())
s.append("S")
t = 0
t_rev = 0

for i in range(4):
    if s[i] == "R":
        t += 1
    elif s[i] == "S":
        t_rev = max(t, t_rev)
        t = 0

print(t_rev)

Submission status: Accepted

Solution code:
import sys

S = input()

r_num = S.count("R")
if r_num == 0:
    print(0)
    sys.exit()
if r_num == 1:
    print(1)
    sys.exit()
if r_num == 2:
    if S[1] == "S":
        print(1)
    else:
        print(2)
if r_num == 3:
    print(3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
li = input()
count = 0
row = 0
if li[0] == "R":
  count += 1
  row = 1
if li[1] == "R":
  if row == 1:
    count += 1
  else:
    row = 1
    count = 1
else:
  row = 0

if li[2] == "R":
  if row == 1:
    count += 1
  else:
    row = 1
    count = 1
else:
  row = 0
print(count)

Submission status: Accepted

Solution code:
s=input()
ans=0
b='R'
for a in s:
    if a=='R' and b=='R':
        ans+=1
    elif a=='R':
        ans=1
    b=a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()
cnt = 0
if W[0]=="R":
  if W[1]=="R":
    if W[2]=="R": cnt=3
    else: cnt=2
  else: cnt=1
else:
  if W[1]=="R":
    if W[2]=="R": cnt=2
    else: cnt=1
  else:
    if W[2]=="R": cnt=1
    else: cnt=0
print(cnt)

Submission status: Accepted

Solution code:
S=input()
c=0
d=0
if S[0]=="R":
	c+=1
	d=c
else:
	c=0
if S[1]=="R":
	c+=1
	d=c
else:
	c=0
if S[2]=="R":
	c+=1
	d=c
else:
	c=0
print(d)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
user = input()
count = 0
maxCount = 0
for i in user:
    if i == "R":
        count += 1
    else:
        if maxCount < count :
            maxCount = count
        count = 0
if maxCount < count :
    maxCount = count
print(maxCount)

Submission status: Accepted

Solution code:
#
# abc175 a
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """RRS"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """SSS"""
        output = """0"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """RSR"""
        output = """1"""
        self.assertIO(input, output)


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


if __name__ == "__main__":
    #unittest.main()
    resolve()

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()
rainy_cnt={"SSS":0,"SSR":1,"RSS":1,"SRS":1,"RSR":1,"SRR":2,"RRS":2,"RRR":3}
print(rainy_cnt[S])

Submission status: Accepted

Solution code:
s = input()
cnt = 0
for i in s:
    if i == 'R':
        cnt += 1
if cnt == 3:
    re = 3
elif cnt == 2:
    if s[1] == 'R':
        re = 2
    else:
        re = 1
elif cnt == 1:
    re = 1
else:
    re = 0
print(re)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S == 'RSR':
    renzoku = 1
else:
    renzoku = 0
    for si in S:
        if si == 'R':
            renzoku += 1

print(renzoku)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def function(X):
    if X=='SRS':
        return 1
    elif X[1] == 'S':
        if (X[0] == 'R') or (X[2] == 'R'):
            return 1
        else:
            return 0
    else:
        if (X[0] == 'R') and (X[2] == 'R'):
            return 3
        elif (X[0] == 'R') or (X[2] == 'R'):
            return 2
        else:
            return 0


if __name__ == '__main__':
    X = input()
    print(function(X))

Submission status: Accepted

Solution code:
mod = 10**9+7
def I(): return int(input())
def LI(): return list(map(int,input().split()))
def MI(): return map(int,input().split())
def LLI(n): return [list(map(int, input().split())) for _ in range(n)]

S = input()
count = 0
max = 0

for i in range(3):
  if(S[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=input()
a=list(S)
r=0
s=[]
for i in a:
  if i=="R":
    r+=1
  elif i=="S":
    s.append(r)
    r=0
s.append(r)
s.sort()
print(s[-1])

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

if S == "SSS":
    cnt = 0
elif S == "RRR":
    cnt = 3
elif "RR" in S:
    cnt = 2
else:
    cnt = 1
    
print(cnt)

Submission status: Accepted

Solution code:
s = input()

Rnum=s.count('R')
ans=1
if Rnum==3:
    ans=3
elif Rnum==0:
    ans=0
elif Rnum==2 and s!='RSR':
    ans=2
elif Rnum==1:
    ans=1

print(ans)

Submission status: Accepted

Solution code:
S = str(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] == 'R' and S[1] == 'S' and S[2] == 'R':
    print(1)
elif S[0] == 'R' and S[1] == 'S' and S[2] == 'S':
    print(1)
elif S[0] == 'S' and S[1] == 'R' and S[2] == 'R':
    print(2)
elif S[0] == 'S' and S[1] == 'R' and S[2] == 'S':
    print(1)
elif S[0] == 'S' 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[1:2]=="R":
  if s[0:1]=="R"and s[2:3]=="R":
    print(3)
  elif s[0:1]=="S"and s[2:3]=="S":
    print(1)
  else:
    print(2)
elif "R" in s:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
# 幅優先探索（行きがけ）
import collections
import sys
import copy
import re
import math


def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())


def main():
    si = S()
    ans = 0
    for i, s in enumerate(si):
        if s == "R":
            if ans > 0 and si[i-1] == "R":
                ans += 1
            elif ans==0:
                ans += 1
                
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import sys
# sys.setrecursionlimit(10**6)
# input = sys.stdin.buffer.readline
# arr = [[int(el) for el in input().split()] for i in range(n)]

s = input()

def sol(s):

    if s == "RRR":
        return 3

    # print (s, s[0], s[1], s[2])

    if (s[0] == s[1] == "R") or (s[1] == s[2] == "R"):
        return 2

    if "R" in s:
        return 1

    return 0

print (sol(s))

Submission status: Accepted

Solution code:
S = input()

cnt = 0

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    S = input()
    S = list(S)

    count = 0
    maxc = 0
    for i in S:
        if i == 'R':
            count += 1
            if maxc < count:
                maxc = count
        else:
            if maxc < count:
                maxc = count
            count = 0

    print(maxc)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = 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:
def main():
    s = input()
    count = 0
    ans = 0

    for i in s:
        if i == 'R':
            count += 1
            if ans < count:
                ans = count
        else:
            if ans < count:
                ans = count
            count = 0

    print(ans)
if __name__ == "__main__":
    main()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S[1:2] == 'S':
    if 'R' in S:
        print(1)
    else:
        print(0)
else:
    if not 'S' in S:
        print(3)
    else:
        if S == 'SRS':
            print(1)
        else:
            print(2)

Submission status: Accepted

Solution code:
import sys
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())
c=0
mx=0
for i in s:
    if i=='R':
        c+=1
    else:
        mx=max(mx,c)
        c=0
print(max(mx,c))

Submission status: Accepted

Solution code:
S = input()


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

Submission status: Accepted

Solution code:
s=input()
r=0
i=0
if s[i]=='R':
  r=r+1

i=i+1
if s[i]=='R':
  r=r+1
  i=i+1
  if s[i]=='R':
    r=r+1
elif s[i+1]=='R' and r==0:
  r=1
  
print(r)

Submission status: Accepted

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

s=input()
count=1

if s=='RRR':
    count=3
elif s=='RRS' or s=='SRR':
    count=2
elif s=='SSS':
    count=0
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
w = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 入力値取得
weathers = input()

if (weathers == "RRR"):
  print(3)
  exit()

if (re.match(r'.*RR.*', weathers)):
  print(2)
  exit()

if (re.match(r'.*R.*', weathers)):
  print(1)
  exit()

print(0)

Submission status: Accepted

Solution code:
import sys
s = sys.stdin.readline().rstrip("\n")
ans = {'SSS': 0,
 'SSR': 1,
 'SRS': 1,
 'SRR': 2,
 'RSS': 1,
 'RSR': 1,
 'RRS': 2,
 'RRR': 3}
print(ans[s])

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import re
S = input()
mmm = re.findall("RRR", S)
mm = re.findall("RR", S)
m = re.findall("R", S)
if mmm:
    print(3)
elif mm:
    print(2)
elif m:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s=input()
ans=0

if s[0]=="R" or s[1]=="R" or s[2]=="R":
  ans=1
if s[0]=="R" and s[1]=="R":
  ans=2

if s[1]=="R" and s[2]=="R":
  ans=2

if s[0]=="R" and s[1]=="R" and s[2]=="R":
  ans=3

print(ans)

Submission status: Accepted

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

s = str(input()).replace("\n", "")

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import bisect as bi
import math
from collections import defaultdict as dd
input=sys.stdin.readline
##sys.setrecursionlimit(10**7)
def cin():
    return map(int,sin().split())
def ain():            
    return list(map(int,sin().split()))
def sin():
    return input()
def inin():
    return int(input())
for _ in range(1):
    s=input().strip()
    n=len(s)
    ans=0
    if('R' in s):
        p=s.index('R');
        c=1
        for i in range(p+1,n):
            if(s[i]=='R'):
                c+=1
            else:
                ans=max(ans,c)
                c=0
        ans=max(ans,c)
    print(ans)

Submission status: Accepted

Solution code:
S = list(input())
a = S.count("R")
ans = a
if(S==["R","S","R"]):
    ans = 1
print(ans)

Submission status: Accepted

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

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

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

if S == 'SRR' or S == 'RRS':
    print(2)
    exit()

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

print(0)

Submission status: Accepted

Solution code:
S = input()
if S == 'RRR' :
    print(3)
elif S == 'RRS' or S == 'SRR' :
    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 = 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()
count=0
ans=0
for i in S:
    if(i=='R'):
        count+=1
    else:
        ans =max(ans,count)
        count = 0
print(max(ans,count))

Submission status: Accepted

Solution code:
S = list(input())

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

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = list(input())
ans = 0
if s[0] == s[1] == s[2] == "R":
    ans = 3
elif s[0] == s[1] == "R" or s[1] == s[2] == "R":
    ans = 2
elif "R" in s:
    ans = 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = input()
c= 0
mx = 0
for i in n:
	if i=='S':
		c = 0
	else:
		c+=1
	if mx<c:
		mx=c
print(mx)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
x = max(map(len,input().split("S")))
print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


S = input()
cnt = 0
before = 1

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


# for s in S:
#     if s == 'R':
#         # cnt += 1
#         if before == 1:
#             cnt += 1
#         before = 1
#     else:
#         cnt += 0
#         before = 0
# print(cnt)

Submission status: Accepted

Solution code:
S=input()
count=0
for i in range(len(S)):
    cur_count=1
    if S[i]=="R":
        for j in range(i+1,len(S)):
            if S[j]!=S[i]:
                break
            cur_count+=1
        if cur_count > count : 
                count = cur_count
    
print(count)

Submission status: Accepted

Solution code:
#A - Rainy Season
S = input()
count = 0
count2 = 0

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


con=False

ans=0
for i in range(3):
  if(s[i]=="R" and con):
    ans+=1
  elif(s[i]=="R" and not(con)):
    ans=1
    con=True
  else:
    con=False
      
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())
rc = 0
rmax = 0
for i in range(3):
  if s[i] == 'R':
    rc += 1
    if rmax <= rc:
      rmax = rc
  else:
    rc = 0
print(rmax)

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)