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

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

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')
in_nl = lambda: list(map(int, readline().split()))
in_nl2 = lambda H: [in_nl() for _ in range(H)]
in_map = lambda: [s == ord('.') for s in readline() if s != ord('\n')]
in_map2 = lambda H: [in_map() for _ in range(H)]
in_all = lambda: map(int, read().split())


def main():

    s = in_s()

    c = s.count('R')
    if c == 0:
        ans = 0
    if c == 1:
        ans = 1
    if c == 2:
        if s == "RSR":
            ans = 1
        else:
            ans = 2
    if c == 3:
        ans = 3

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    count = 0
    for i in input():
        if i != "R" and count > 0:
            break
        elif i == "R":
            count += 1
    print(count)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()
print(('R'in s)+('RR'in s)+('RRR'in s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

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":
    ans = 3
elif S == "RRS" or S == "SRR":
    ans = 2
elif "R" in S:
    ans = 1
else:
    ans = 0
print(ans)

Submission status: Accepted

Solution code:
# import sys; input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

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

#処理内容
def main():
	S = input()
	cnt = 0
	val = 0
	for i in S:
		if i != "S":
			val += 1
			cnt = max(val, cnt)
		else:
			cnt = max(val, cnt)
			val = 0

	cnt = max(val, cnt)
	print(cnt)


	




if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
# by the authority of GOD     author: manhar singh sachdev #

import os,sys
from io import BytesIO, IOBase

def main():
    s = input().strip()
    cou=maxi=0
    for i in s:
        if i=='R':
            cou += 1
        else:
            maxi = max(maxi,cou)
            cou = 0
    maxi = max(maxi,cou)
    print(maxi)
#Fast IO Region
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")

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
for i in range(3,0,-1):
    if(('R'*i) in s):
        print(i)
        exit()
print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys


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


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



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial, gcd
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10 ** 7)
enu = enumerate
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep="\n")

S = input()

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

Submission status: Accepted

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

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()
count=0
l=[]
for i in range(len(s)):
    if(s[i]=='R'):
        count+=1
    else:
        l.append(count)
        count=0
l.append(count)
print(max(l))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


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

    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [input() for i in range(n)]

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

Submission status: Accepted

Solution code:
import sys
from itertools import groupby
input = sys.stdin.readline
S = input()

dic = groupby(S)
ans = 0
for i,v in dic:
    v = list(v)
    if i == 'R':
        ans = max(ans, len(v))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    S = input()
    if 'RRR' in S:
        return 3
    if 'RR' in S:
        return 2
    if 'R' in S:
        return 1
    return 0


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

Submission status: Accepted

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

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()
prev = "R"
res = 0
a = 0
for c in s :
    if c=="R" :
        a+=1
    else :
        a = 0
    res = max(res, a)
print(res)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
import re
import sys
from collections import (
    Counter,
    defaultdict as ddict,
    deque,
)
from functools import lru_cache
from heapq import *
from itertools import *
from string import (
    ascii_letters as letters,
    ascii_lowercase as ucletters,
    ascii_uppercase as lcletters,
    digits,
)

alnum=digits+letters
hexdigits=digits+'ABCDEFabcdef'

cache=lru_cache(None)

inf=float('inf')
ansmod=1000000007
int8_min=-128
int16_min=-32768
int32_min=-2147483648
int64_min=-9223372036854775808
int8_max=127
int16_max=32767
int32_max=2147483647
int64_max=9223372036854775807
uint8_max=255
uint16_max=65535
uint32_max=4294967295
uint64_max=18446744073709551615

rfs=lambda:rl().split()
ri=lambda:int(rl())
ris=lambda:list(map(int,rfs()))
rl=lambda:next(sys.stdin)
rrs=lambda:list(map(str.strip,sys.stdin))
rs=lambda:rl().strip()
rt=lambda:sys.stdin.read()
rg=lambda:list(map(list,rrs()))
rig=lambda:[[*map(int,x.split())] for x in rls()]

def nbs4(i,j):
    return [
                (i-1,j),
        (i,j-1),        (i,j+1),
                (i+1,j),
    ]

def nbs8(i,j):
    return [
        (i-1,j-1),(i-1,j),(i-1,j+1),
        (  i,j-1),        (  i,j+1),
        (i+1,j-1),(i+1,j),(i+1,j+1),
    ]

inb=lambda i,j,m,n:0<=i<m and 0<=j<n

sys.setrecursionlimit(int32_max)

################################################

S=input()
ans=k=0
for x in S:
    if x=='R':
        k+=1
    else:
        k=0
    ans=max(ans,k)
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from collections import *

s = input()[:-1]
l = []
cnt = 1
    
for i in range(len(s)-1):
    if s[i]!=s[i+1]:
        l.append((s[i], cnt))
        cnt = 1
    else:
        cnt += 1
    
l.append((s[-1], cnt))
ans = 0

for si, c in l:
    if si=='R':
        ans = max(ans, c)

print(ans)

Submission status: Accepted

Solution code:
S = input()
rainy = 0
answer = 0
for s in S:
    if s == 'R':
        rainy += 1
        if rainy > answer:
            answer = rainy
    else:
        rainy = 0
print(answer)

Submission status: Accepted

Solution code:
S=input()

if S=="RRR":
    print(3)
elif S=="RRS" or S=="SRR":
    print(2)
elif S.find("R")!=-1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
"""
                            pppppppppppppppppppp
                         ppppp  ppppppppppppppppppp
                      ppppppp    ppppppppppppppppppppp
                      pppppppp  pppppppppppppppppppppp
                      pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
       ppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppp
      pppppppppppppppppppppppppppppppppppppppppppppppp  ppppppppppppppppppppp
     ppppppppppppppppppppppppppppppppppppppppppppppppp  pppppppppppppppppppppp
    ppppppppppppppppppppppppppppppppppppppppppppppp    pppppppppppppppppppppppp
   pppppppppppppppppppppppppppppppppppppppppppppp     pppppppppppppppppppppppppp
  ppppppppppppppppppppppppppppppppppppppppppppp      pppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppppppp               pppppppppppppppppppppppppppppppp
  pppppppppppppppppppppppppppp     pppppppppppppppppppppppppppppppppppppppppppppp
  ppppppppppppppppppppppppppp    pppppppppppppppppppppppppppppppppppppppppppppppp
    pppppppppppppppppppppppp  pppppppppppppppppppppppppppppppppppppppppppppppppp
     ppppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppppp
      pppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppppp
       ppppppppppppppppppppp  ppppppppppppppppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppppp
                              pppppppppppppppppppppppppppppppp
                              pppppppppppppppppppppp  pppppppp
                              ppppppppppppppppppppp    ppppppp
                                 ppppppppppppppppppp  ppppp
                                    pppppppppppppppppppp
"""


import sys
from functools import lru_cache, cmp_to_key
from collections import defaultdict as dd, deque, Counter as C
from bisect import bisect_left as bl, bisect_right as br, bisect
from heapq import heapify, heappop, heappush
from math import ceil, log, floor, sqrt
mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(var, end="\n"): sys.stdout.write(str(var)+end)
def outa(*var, end="\n"): sys.stdout.write(' '.join(map(str, var)) + end)
def L(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


answer = 0
s = data()
cnt = 0
for i in s:
    if i == "S":
        answer = max(answer, cnt)
        cnt = 0
    else:
        cnt += 1
out(max(answer, cnt))

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if s in ['SSS']:
    ans = 0
elif s in ['SSR', 'SRS', 'RSS', 'RSR']:
    ans = 1
elif s in ['SRR', 'RRS']:
    ans = 2
else:
    ans = 3

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
rcount=0
for i in range(3):
  if s[i]=='R':
    rcount+=1
if s=='RSR':
  rcount-=1
print(rcount)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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 "R" in s:
    print(1)
else:
    print(0)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

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

count = 0
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

S = input()

M = 0
m = 0
for w in S:
  if w == 'R':
    m += 1
  else:
    m = 0
  if m > M:
    M = m

print(M)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = 0
    cnt = 0
    for c in s:
        if c == "R":
            cnt += 1
            if ans < cnt:
                ans = cnt
        else:
            cnt = 0
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input().strip()
ans = 0
c = 0
for s in S:
    if s == "R":
        c += 1
    else:
        c = 0
    ans = max(ans, c)
print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

def it(s):
    c = 0
    for v in s:
        if v == 'R':
            c += 1
        else:
            c = 0
        yield c

print(max(it(S)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import random


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return (a * b) / gcd(a, b)

s=input()
c=0
a=[]
for i in s:
    if i=='R':
        c+=1
    else:
        a.append(c)
        c=0
a.append(c)
print(max(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def solve():
    input = sys.stdin.readline
    S = input()
    if "RRR" in S:
        print(3)
    elif "RR" in S:
        print(2)
    elif "R" in S:
        print(1)
    else:
        print(0)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:

def main():
    s = input()
    counter = 0
    mx = 0
    for c in s:
        if c == "S":
            counter = 0
        else:
            counter += 1
            mx = max(counter,mx)

    print(mx)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()
a = n.count("R")
if n[1]=="S" and a == 2:
    a  = 1
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin,stdout
for _ in range(1):#int(stdin.readline())):
    # p=int(stdin.readline())
    # a=list(map(int,stdin.readline().split()))
    s=input().split('S')
    print(max(len(wrd) for wrd in s))

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:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache

#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')
AZ = "abcdefghijklmnopqrstuvwxyz"

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


#####Shorten#####
def DD(arg): return defaultdict(arg)

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n): return kaijo_memo[n]
  if(len(kaijo_memo) == 0): kaijo_memo.append(1)
  while(len(kaijo_memo) <= n): kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n): return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0): gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n): gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if n == r: return 1
  if n < r or r < 0: return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1: arr.append([temp, 1])
  if arr==[]: arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

#####GCD#####
def gcd(a, b):
    while b: a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n-1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n: return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

def base_10_to_n_without_0(X, n):
  X -= 1
  if X//n: return base_10_to_n_without_0(X//n, n)+[X%n]
  return [X%n]

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

S = S()

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 "R" in S:
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain, product
from functools import lru_cache
from collections import deque, defaultdict
from operator import itemgetter
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'



def main():
    S = input()
    if S == 'RSR':
        print(1)
    else:
        print(S.count('R'))







main()

Submission status: Accepted

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

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

S = input()
succ = 0
ans = 0
for ch in S:
    if ch == 'R':
        succ += 1
        ans = max(ans, succ)
    else:
        succ = 0
ans = max(ans, succ)
print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
l=input()
from itertools import groupby as gb
var=[(a,len(list(b))) for a,b in gb(l)]
ans=0
for k,v in var:
    if k=="R":ans=max(ans,v)
print(ans)

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

Submission status: Accepted

Solution code:
s = input().rstrip()
x = 0
for i in range(len(s)):
    if s[i] == 'R':
        x += 1
    elif x > 0:
        print(x)
        exit(0)
print(x)

Submission status: Accepted

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

ans = 0
cur = 0
for s in S:
    if s == 'R':
        cur += 1
        if cur > ans:
            ans = cur
    else:
        cur = 0

print(ans)

Submission status: Accepted

Solution code:
s = input()

if s[1] == "R":
  print(s.count("R"))
else:
  if "R" in s:
    print(1)
  else:
    print(0)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

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





if __name__ == "__main__":
    main()