Problem:


Score : 100 points

Problem Statement

We have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.

Find the maximum number of consecutive rainy days in this period.

Constraints

|S| = 3

Each character of S is S or R.

Input

Input is given from Standard Input in the following format:

S

Output

Print the maximum number of consecutive rainy days in the period.

Sample Input 1

RRS

Sample Output 1

2

We had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.

Sample Input 2

SSS

Sample Output 2

0

It was sunny throughout the period. We had no rainy days, so we should print 0.

Sample Input 3

RSR

Sample Output 3

1

We had rain on the 1-st and 3-rd days - two "streaks" of one rainy day, so we should print 1.



Sample input:
RRS


Sample output:
2

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = 0
tmp = 0
for c in x:
    if c == 'R':
        tmp += 1
        ans = max(ans, tmp)
    else:
        tmp = 0
print(ans)

Submission status: Accepted

Solution code:
import sys, math
from collections import defaultdict, deque, Counter
from bisect import bisect_left, bisect_right
from itertools import combinations, permutations, product
from heapq import heappush, heappop
from functools import lru_cache
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 1000000007
sys.setrecursionlimit(1000000)

S = rs()

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()
    
    if S.count('R') in (0, 1, 3):
        print(S.count('R'))
    elif S[0] == S[2]:
        print(1)
    else:
        print(2)
        
    
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    S = input()
    if S == 'RRR':
        return 3
    elif 'RR' in S:
        return 2
    elif 'R' in S:
        return 1
    return 0
print(main())
#if main():
#    print('Yes')
#else:
#    print('No')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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()
if s.count('R')<2 or s.count('R')==3:
    print(s.count('R'))
else:
    print(1 if s=='RSR' else 2)

Submission status: Accepted

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

Submission status: Accepted

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

def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    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__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

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

x = 0
cnt = 0
for s in S:
    if s == 'R':
        cnt += 1
    else:
        cnt = 0

    x = max(x, cnt)

print(x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(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 = s.count("R")
if ans == 2 and s == "RSR":
    ans = 1
print(ans)

Submission status: Accepted

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys;input = sys.stdin.readline
inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]

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

Submission status: Accepted

Solution code:
from itertools import*
d = [len(list(l)) for k, l in groupby(input()) if k == "R"]
print(max(d) if d else 0)

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict, Counter, namedtuple, deque
import itertools
import functools
import bisect
import heapq
import math
import copy
# from fractions import gcd

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

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

Submission status: Accepted

Solution code:
import sys

def input(): return sys.stdin.readline().strip()
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 INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 19 + 7
EPS = 10 ** -10

S = input()

cnt = 0
ans = 0
for i in range(3):
    if S[i] == 'R':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
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:
def RunLengthEncoding(S):
    res = []
    N = len(S)
    i = 0
    while i < N:
        cnt = 1
        while i < N - 1 and S[i] == S[i + 1]:
            cnt += 1
            i += 1
        res.append((S[i], cnt))
        i += 1
    return res


S = input()
rle = RunLengthEncoding(S)
ans = 0
for k, v in rle:
    if k == "R":
        ans = max(ans, v)

print(ans)

Submission status: Accepted

Solution code:
S = list(input())
out = 0
if "R" in S:
    out += 1
for i in range(2):
    if S[i]==S[i+1] and S[i]=="R":
        out += 1
print(out)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from itertools import accumulate

sys.setrecursionlimit(10**6)
INF = 10**12
m = 10**9 + 7

def main():
    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__":
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce, lru_cache
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 TUPLE(): return tuple(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 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

S = input()

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

print(ans)

Submission status: Accepted

Solution code:
W=input()
M=0

if W[0]=="R" or W[1]=="R" or W[2]=="R":
    M=1

if W[0]==W[1]=="R" or W[1]==W[2]=="R":
    M=2

if W=="RRR":
    M=3

print(M)

Submission status: Accepted

Solution code:
def main():

    S = input()
    if "RRR" in S: return 3
    elif "RR" in S: return 2
    elif "R" in S:  return 1
    return 0
if __name__ == '__main__':
    print(main())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def examA():
    S = SI()
    ans = 0
    if "R" in S:
        ans = 1
    if "RR" in S:
        ans = 2
    if "RRR" in S:
        ans = 3
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Accepted

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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:
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()
c=0
ans=0
for i in list(S):
    if i=='S':c=0
    else:c+=1
    ans=max(ans,c)
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()
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
now=0
for i in range(len(S)):
   if S[i] == "R":
      now+=1
   else:
      now=0
   ans=max(ans,now)
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def main():
    S = input()
    if 'RRR' == 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:
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

s = input().rstrip()
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, os, math, bisect, itertools, collections, heapq, queue, copy, array

# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
# from decimal import Decimal
# from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

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


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = iss()
    ret = 0
    tmp = 0
    for s in S:
        if s == 'R':
            tmp += 1
        else:
            tmp = 0
        ret = max(tmp, ret)
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)
mod = 10**9+7
dir = [(-1,0),(0,-1),(1,0),(0,1)]
alp = "abcdefghijklmnopqrstuvwxyz"

def main():
    s = input()
    ma = 0
    maa = 0
    for i in s:
        if i == "R":
            ma += 1
            if ma > maa:
                maa = ma
        else:
            ma = 0
    print(maa)

    return None

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
## for use in beginner level questions where speed is key
## and also for single test case code
## mastercopy for x,y,z

import sys
import heapq, functools, collections
import random
from collections import Counter, defaultdict

# read line as a string
strr = input()

# read line as an integer
# k = int(input())

# read one line and parse each word as a string
# lst = input().split()

# read one line and parse each word as an integer
# arr = list(map(int,input().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    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__':
    main()

Submission status: Accepted

Solution code:
s=(input())
mx=0
for i in range(1,4):
    if(s.count('R'*i)):
        mx=i
print(mx)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inl = lambda: [int(x) for x in sys.stdin.readline().split()]
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


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


print(solve())

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    if len(x) == 0:
        return []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

po = input()[:-1]

p = s(po)

cou = 0

for i in p:
    if i[0] == "R":
        cou = max(i[1],cou)
print(cou)

Submission status: Accepted

Solution code:
def main():
    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__':
    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()
ls = []
now = 0
for i in range(3):
    if S[i] == "R":
        now += 1
    else:
        ls.append(now)
        now = 0
ls.append(now)
print(max(ls))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

Submission status: Accepted

Solution code:
# Template 1.0
import sys, re
from decimal import *
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, floor, trunc, log
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

s = input()

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

Submission status: Accepted

Solution code:
print max(len(s) for s in raw_input().split('S'))

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()

s = ns()
ans = 0
rep = 0
for i in s:
    if i == "R":
        rep += 1
    else:
        rep = 0
    ans = max(ans, rep)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
for i in range(4)[::-1]:
    if 'R' * i in S:
        print(i)
        exit()

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

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

#Solve
if __name__ == "__main__":
    solve()

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:
# ------------------- fast io --------------------
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")

# ------------------- fast io --------------------
from math import gcd, ceil

def pre(s):
    n = len(s)
    pi = [0] * n
    for i in range(1, n):
        j = pi[i - 1]
        while j and s[i] != s[j]:
            j = pi[j - 1]
        if s[i] == s[j]:
            j += 1
        pi[i] = j
    return pi


def prod(a):
    ans = 1
    for each in a:
        ans = (ans * each)
    return ans

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


def binary(x, length=16):
    y = bin(x)[2:]
    return y if len(y) >= length else "0" * (length - len(y)) + y


for _ in range(int(input()) if not True else 1):
    #n = int(input())
    #n, k = map(int, input().split())
    #a, b = map(int, input().split())
    #c, d = map(int, input().split())
    #a = list(map(int, input().split()))
    #b = list(map(int, input().split()))
    s = input()
    ans = 0
    cur = 0
    for i in s:
        if i == "R":
            cur += 1
        else:
            ans = max(ans, cur)
            cur = 0
    print(max(ans, cur))

Submission status: Accepted

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

Submission status: Accepted

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

import sys
sys.setrecursionlimit(300000)


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

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:
from itertools import groupby
res = 0
s = input()
for k, v in groupby(s):
    if k == 'R':
        res = max(res, len(list(v)))
print(res)

Submission status: Runtime Error

Solution code:
a = input()
count = 0

for i in range(len(a)):
  if i = 'R':
    count += 1

print(count)

Submission status: Runtime Error

Solution code:
#abc175b
n=int(input())
l=list(map(int,input().split()))
l.sort()
cnt=0
for i in range(n):
 for j in range(i):
  for k in range(j):
   if l[k]!=l[j] and l[i]!=l[j] and l[k]+l[j]>l[i]:
    cnt+=1
print(cnt)

Submission status: Runtime Error

Solution code:
S=input()
count=[]
s=0
for i in range(3):
    if S[i]=='R':
        if i==2 or S[i+1]=='S':
            s=s+1
            count.append(s)
            s=0
        else:
            s=s+1
print(max(count))

Submission status: Runtime Error

Solution code:
weather = [input(), input(), input()]
for i in weather:
  rd = 0
  if weather[i] == 'R':
    rd += 1
if rd != 2:
  print(rd)
else:
  if weather[1] == 'R':
    print(rd)
  else:
    print(rd - 1)

Submission status: Runtime Error

Solution code:
s=list(input())


c=[]
for i in range(3):
  
  if s[i]=='R':
    cnt=0
    
    while i<3:
      if s[i]=='R':
        cnt+=1
        i+=1
        
      else:
        break
        
    c.append(cnt)
    
print(max(c))

Submission status: Runtime Error

Solution code:
S = int(input())

flag = False
ans = 0
for i in range(len(S)):
    if S[i] == 'R':
        ans += 1
        flag = True
    elif S[i] == 'S' and flag:
        break

print(ans)