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 sys
import math
import collections
import bisect
import itertools

# import numpy as np

sys.setrecursionlimit(10 ** 7)
INF = 10 ** 20
MOD = 10 ** 9 + 7
# MOD = 998244353

ni = lambda: int(sys.stdin.readline().rstrip())
ns = lambda: map(int, sys.stdin.readline().rstrip().split())
na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))
na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))


# ===CODE===

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    S = input()

    res = 0
    temp = 0
    for item in S:
        if item == 'R':
            temp += 1
        else:
            temp = 0

        res = max(res, temp)

    print(res)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

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

s = s_in()

if 'RRR' in s:
    print(3)
    exit()
if 'RR' in s:
    print(2)
    exit()
if 'R' in s:
    print(1)
    exit()
    

print(0)

Submission status: Accepted

Solution code:
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))


s=list(input().split("S"))
ans=0
for i in s:
    ans=max(ans,len(i))
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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


def solve(S: str):
    a = 0
    m_a = 0
    for s in S:
        if s == "R":
            a+=1
            m_a  = max(a,m_a)
        else:
            a=0
    print(m_a)


    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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


def read():
    S = input().strip()
    return S,


def solve(S):
    ans = 0
    rain = 0
    for s in S:
        if s == "R":
            rain += 1
        else:
            ans = max(ans, rain)
            rain = 0
    ans = max(ans, rain)
    return ans


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

Submission status: Accepted

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

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

if __name__ == "__main__":
    resolve()

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=input()
ans=chk=0
for i in s:
    if i=="R":
        chk+=1
    else:
        chk=0
    ans=max(ans,chk)
print(ans)

Submission status: Accepted

Solution code:
s=raw_input()

def solve(s):
    arr=list(s.split("S"))
    return len(max(arr,key=len))
print(solve(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
from functools import reduce
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

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

Submission status: Accepted

Solution code:
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192
class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
INF = 10 ** 18
MOD = 10**9+7

Ri = lambda : [int(x) for x in sys.stdin.readline().split()]
ri = lambda : sys.stdin.readline().strip()


s = ri()
cnt = 0
flag = False
ans = 0
if s[0] == 'R':
    cnt+=1
    flag = True
    ans = 1
for i in range(1, 3):
    if s[i] == 'R':
        if flag :
            cnt+=1
        else:
            flag = True
            cnt = 1
    else:
        flag = False
    ans=  max(ans, cnt)
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from collections import deque
from decimal import *
import queue
from functools import reduce

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	S = inputStr()
	ans = 0

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

Submission status: Accepted

Solution code:
LL = input()


count = 0
maxcount = 0

for ll in LL:
    if ll == "R":
        count+= 1
    else:
        count = 0
    
    if maxcount <= count:
        maxcount = count

print(maxcount)

Submission status: Accepted

Solution code:
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
input = sys.stdin.readline
INF = float("inf")


# 処理内容
def main():
    S = input()[:-1]
    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()

ans = S.count('R')
if ans == 2 and S[1] == 'S':
  ans = 1
print(ans)

Submission status: Accepted

Solution code:
#--a--#

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

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
import bisect
import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal

INF = 1 << 50


def run():
    S = input()
    ans = 0
    max_val = 0
    for s in S:
        if s == 'R':
            ans += 1
            max_val = max(max_val, ans)
        else:

            ans = 0
    print(max_val)

if __name__ == "__main__":
    run()

Submission status: Accepted

Solution code:
S = input()
cnt = 0
cmax = 0
for c in S:
  if c == "R":
    cnt += 1
    if cmax < cnt:
      cmax = cnt
  else:
    cnt = 0
print(cmax)

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:
S = input()
if S.count("RRR"):  print(3)
elif S.count("RR"):  print(2)
elif S.count("R"):  print(1)
else:  print(0)

Submission status: Accepted

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


def readstr():
    return input().strip()


def readint():
    return int(input())


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


def readstrs():
    return input().split()


def main():
    S = readstr()
    if S == 'RRR':
        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 == 'RRR':
    print(3)
elif s == 'SSS':
    print(0)
else:
    if s.count('RR') > 0:
        print(2)
    else:
        print(1)

Submission status: Accepted

Solution code:
s = input()
ans = 0
if s[0] == "R":
    cnt = 1
else:
    cnt = 0
ans = cnt
for i in range(1, 3):
    if s[i] == "R":
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 0
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=str(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:
a = input()
if a == 'SSS':
  print(0)
elif a == 'RSS' or a == 'SRS' or a=='SSR' or a=='RSR':
  print(1)
elif a == 'RRS' or a== 'SRR':
  print(2)
else:
  print(3)

Submission status: Accepted

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

Submission status: Accepted

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

ret = 0
if n.count("R"):
    ret = 1
if n.count("RR"):
    ret = 2
if n.count("RRR"):
    ret = 3
print(ret)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S=="SSS":
    print(0)
elif S=="RSS" or S=="SRS" or S=="SSR" 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()

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[2] == "R" and s[1] == "R":
  print(2)
elif s.count("R") >= 1:
  print(1)
else:
  print(0)

Submission status: Accepted

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

main()

Submission status: Accepted

Solution code:
s = list(input())
ans = 0
a = []
if s[0] == "R":
  ans += 1
else:
  a += [ans]
  ans = 0
if s[1] == "R":
  ans += 1
else:
  a += [ans]
  ans = 0
if s[2] == "R":
  ans += 1
else:
  a += [ans]
  ans = 0
a += [ans]
print(max(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    if S.count('R') == 0:
        print(0)
        exit()
    cnt = 1
    for i in range(2):
        if S[i] == 'R' and S[i+1] == 'R':
            cnt += 1 

    print(cnt)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def main():
    #l,r,d=map(int,input().split())
    s=input()
    ans=0
    if s=="RSS" or s=="SRS" or s=="SSR" or s=="RSR":
        ans=1
    elif s=="RRS" or s=="SRR":
        ans=2
    elif s=="RRR":
        ans=3
    print(ans)


if __name__ == "__main__":

    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
S = input()
if S=="RRR":
    print(3)
elif "RR" in S:
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
if __name__=="__main__":
    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
read = sys.stdin.read
readlines = sys.stdin.readlines

def main():
    s = input()
    r = 0
    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:
#!python3

import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())

def resolve():
    s = input()

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

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
a=input()

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

Submission status: Accepted

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

    maxren = 0
    ren = 0
    for c in s:
        if c == "R":
            ren += 1
            maxren = max(maxren, ren)
        else:
            ren = 0
    print(maxren)


main()

Submission status: Accepted

Solution code:
s = list(input())

count = 0
ans=0

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
s=input()
ans=0
cnt=0
for i in range(len(s)):
        if s[i]=="R":
                cnt+=1
        else:
                ans=max(ans,cnt)
                cnt=0
ans=max(ans,cnt)
print(ans)

Submission status: Accepted

Solution code:
import sys
input=lambda: sys.stdin.readline().rstrip()
S=input()
if S=="RRR":
	print(3)
elif "RR" in S:
	print(2)
elif "R" in S:
	print(1)
else:
	print(0)

Submission status: Accepted

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

Submission status: Accepted

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

ans = max(ans, cnt)
print(ans)

Submission status: Accepted

Solution code:
inp = input()

print(max(map(len, inp.split("S"))))

Submission status: Accepted

Solution code:
import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
def celi(a,b):
    return -(-a//b)
sys.setrecursionlimit(5000000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

Submission status: Accepted

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

def solve():
    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)


if __name__ == "__main__":
    solve()

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:
a = input()
cnt = 0
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:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    s = input().rstrip()
    ans = 0
    count = 0

    for c in s:
        if c == "R":
            count += 1
        else:
            if ans < count:
                ans = count
            count = 0

    if ans < count:
        ans = count
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
s=input()

c=s.count('R')
if c==2 and s=='RSR':
    c=1
print(c)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
#input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

#N = int(input())
#N, M = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]
#ABC = [list(map(int, input().split())) for _ in range(N)]
S = input()
#S = [input() for _ in range(N)]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!python3.8
# -*- coding: utf-8 -*-
# abc175/abc175_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    if 'RRR' == S:
        print(3)
    elif 'RR' in S:
        print(2)
    elif 'R' in S:
        print(1)
    else:
        print(0)
    return


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().strip()
f=S.count('R')
if S=="RSR":
    f=1
print(f)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

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

Submission status: Accepted

Solution code:
s = input()

if 'RRR' in s:
   result = 3
elif 'RR' in s:
   result = 2
elif 'R' in s:
   result = 1
else:
   result = 0

print(result)

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:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do(): 
    s=STR()
    ans=0
    temp=0
    for i in s:
        if i=='R':
            temp+=1
            ans=max(temp,ans)
        else:
            temp=0
    print(ans)
    
if __name__ == '__main__':
    do()

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:
mod = 10**9 + 7
def solve():
    s = input() + 'S'
    ans = 0
    tmp = 0
    for c in s:
        if c == 'R':
            tmp += 1
        else:
            tmp = 0
        ans = max(ans, tmp)
    print(ans)
t = 1
while t > 0:
    solve()
    t -= 1

Submission status: Accepted

Solution code:
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    s = SI()
    cnt = 0
    ans = 0
    for x in s:
        if x == 'R':
            cnt +=1
            ans = max(ans,cnt)
        else: cnt = 0
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    S = input()
    res = 0
    cnt = 0
    for s in S:
        if s == "R":
            cnt += 1
            res = max(res, cnt)
        else:
            cnt = 0
    print(res)


if __name__ == '__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()

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

Submission status: Accepted

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

import sys


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


def main():
    s = std_in()
    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.count('R')==3:
  print(3)
elif s[0]==s[1]=='R' or s[1]==s[2]=='R':
  print(2)
elif s.count('R')!=0:
  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 'R' in s:
    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:
# import sys
# input = sys.stdin.readline

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

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

Submission status: Accepted

Solution code:
S = input()
Sl = S.split("S")
maxi = 0
for s in Sl:
    maxi = max(maxi, len(s))
print(maxi)

Submission status: Accepted

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

if __name__=="__main__":
    main()