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:
"""
    Satwik_Tiwari ;) .
    14th AUGUST , 2020  - FRIDAY
"""

#===============================================================================================
#importing some useful libraries.
from __future__ import division, print_function

from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase

from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter  # Counter(list)  return a dict with {key: count}
from itertools import combinations as comb # if a = [1,2,3] then print(list(comb(a,2))) -----> [(1, 2), (1, 3), (2, 3)]
from itertools import permutations as permutate
from bisect import bisect_left as bl
#If the element is already present in the list,
# the left most position where element has to be inserted is returned.
from bisect import bisect_right as br
from bisect import bisect
#If the element is already present in the list,
# the right most position where element has to be inserted is returned

#==============================================================================================
#fast I/O 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")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

# inp = lambda: sys.stdin.readline().rstrip("\r\n")

#===============================================================================================
### START ITERATE RECURSION ###
from types import GeneratorType
def iterative(f, stack=[]):
  def wrapped_func(*args, **kwargs):
    if stack: return f(*args, **kwargs)
    to = f(*args, **kwargs)
    while True:
      if type(to) is GeneratorType:
        stack.append(to)
        to = next(to)
        continue
      stack.pop()
      if not stack: break
      to = stack[-1].send(to)
    return to
  return wrapped_func
#### END ITERATE RECURSION ####

#===============================================================================================
#some shortcuts

mod = 1000000007
def inp(): return sys.stdin.readline().rstrip("\r\n") #for fast input
def out(var): sys.stdout.write(str(var))  #for fast output, always take string
def lis(): return list(map(int, inp().split()))
def stringlis(): return list(map(str, inp().split()))
def sep(): return map(int, inp().split())
def strsep(): return map(str, inp().split())
# def graph(vertex): return [[] for i in range(0,vertex+1)]
def zerolist(n): return [0]*n
def nextline(): out("\n")  #as stdout.write always print sring.
def testcase(t):
    for p in range(t):
        solve()
def printlist(a) :
    for p in range(0,len(a)):
        out(str(a[p]) + ' ')
def lcm(a,b): return (a*b)//gcd(a,b)
def power(x, y, p) :
    res = 1     # Initialize result
    x = x % p  # Update x if it is more , than or equal to p
    if (x == 0) :
        return 0
    while (y > 0) :
        if ((y & 1) == 1) : # If y is odd, multiply, x with result
            res = (res * x) % p

        y = y >> 1      # y = y/2
        x = (x * x) % p
    return res
def ncr(n,r): return factorial(n)//(factorial(r)*factorial(max(n-r,1)))
def isPrime(n) :
    if (n <= 1) : return False
    if (n <= 3) : return True
    if (n % 2 == 0 or n % 3 == 0) : return False
    i = 5
    while(i * i <= n) :
        if (n % i == 0 or n % (i + 2) == 0) :
            return False
        i = i + 6
    return True

#===============================================================================================
# code here ;))

def solve():
    s = inp()

    ans = 0
    for i in range(3):
        for j in range(i,4):
            # print(s[i:j],j,i)
            if(s[i:j]=='R'*(j-i)):
                ans = max(ans,j-i)
    print(ans)





testcase(1)
# testcase(int(inp()))

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()
try:
  S.index('RRR')
  print(3)
except:
  try:
    S.index('RR')
    print(2)
  except:
    try:
      S.index('R')
      print(1)
    except:
      print(0)

Submission status: Accepted

Solution code:
#coding:utf-8

s = str(input())

count = 0
ans = 0

for i in s:
    if i == "R":
        count += 1
    elif i == "S":
        count = 0
    ans = max(ans,count)

print("{}".format(ans))

Submission status: Accepted

Solution code:
S = input()
ans = 0
if S[0] == 'R':
    if S[1] == 'R':
        ans = 2
        if S[2] == 'R':
            ans =3
    if S[1] == 'S':
        ans=1
else:
    if S[1] == 'R':
        if S[2] == 'R':
            ans = 2
        else:
            ans = 1
    else:
        if S[2] == 'R':
            ans = 1
print(ans)

Submission status: Accepted

Solution code:
n = input()

cnt = 0
flag = False
if n[1] == 'S':
    if 'R' in n:
        print(1)
        flag = True
    else:
        print(0)
        flag = True
if flag == False:
    for i in n:
        if i == 'R':
            cnt += 1
    print(cnt)

Submission status: Accepted

Solution code:
S =str(input())
rainydays=0
for i in S:
    if i =='R':
        rainydays+=1
if S[1]=='S':
    if rainydays==2:
        rainydays=1
print(rainydays)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = 0
if 'RRR' in S:
    ans = 3
elif 'RR' in S:
    ans = 2
elif 'R' in S:
    ans = 1
else:
    ans = 0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = str(input())
count = []
x = 0 
for i in range(len(s)):
    if s[i] == "R":
        x += 1
        if i == len(s)-1:
            count.append(x)
    if s[i] == "S":
        count.append(x)
        x = 0

print(max(count))

Submission status: Accepted

Solution code:
s=str(input())
c=s.count("R")
if c>=1 and s[1]=="S":
    print(1)
else:
    print(c)

Submission status: Accepted

Solution code:
import sys
from itertools import product,combinations
from functools import reduce,lru_cache
import heapq

def vfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:f(*x,**kwargs),*lst))

def rvfunc(f): return lambda *lst, **kwargs: list(map(lambda *x:rvfunc(f)(*x,**kwargs) if all(vfunc(lambda y:isinstance(y,list))(x)) else f(*x,**kwargs),*lst))

def reader():return vfunc(lambda l:l.split())(sys.stdin.readlines())

s=reader()

print(max(vfunc(len)(s[0][0].split('S'))))

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

Submission status: Accepted

Solution code:
import itertools
S = input()

cnt = 0
gr = itertools.groupby(S)
for key, group in gr:
    if key == "R":
        cnt = max(cnt, len(list(group)))

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

w1 = s[0]
w2 = s[1]
w3 = s[2]

if w2 == 'R':
	if w1 != w3:
		print(2)
	elif w1 == 'S':
		print(1)
	else:
		print(3)
else:
	if w1 != w3:
		print(1)
	elif w1 == 'S':
		print(0)
	else:
		print(1)

Submission status: Accepted

Solution code:
s = input()

if s == "SSS":
    print(0)
    exit()

cnt = 1
if s[0] == "R" and s[1] == "R":
    cnt += 1
if s[2] == "R" and s[1] == "R":
    cnt += 1

if cnt == 1:
    print(cnt)
else:
    print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]


S = str(input())
flag = 2
ans = 0

for i in range(3):
    if(S[i]=="R"):
        if(flag==1):
            ans +=1
        elif(ans == 0):
            ans = 1
        flag = 1
    else:
        flag = 0

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ans=0
for i in range(3):
	if s[i]=='R':
		ans+=1
if ans>=1 and s[1]!='R':
	ans=1
print(ans)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
INF = 10**9
mod = 10**9+7

S = s()
if 'R' not in S:
    ans = 0
else:
    ans = 1
for i in range(2):
    if S[i] == S[i+1] == 'R':
        ans = 2
if 'S' not in S:
    ans = 3
print(ans)

Submission status: Accepted

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

print(max(map(len, s.split('S'))))

Submission status: Accepted

Solution code:
S = input()

counts = []
count = 0
for s in S:
    if s =='R':
        count += 1
    else:
        counts.append(count)
        count = 0

counts.append(count)
ret = max(counts)
print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()
S=list(s)

num=S.count('R')

if num==2:
    if s=='RSR':
        print("1")
    else:
        print('2')
else:
    print(num)

Submission status: Accepted

Solution code:
import sys
import bisect
import itertools
import collections
import fractions
import heapq
import math
from operator import mul
from functools import reduce
from functools import lru_cache


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    S = input()
    count = 0
    for i in S:
        if i == 'R':
            count += 1
    if count == 0:
        print(0)
    elif count == 1:
        print(1)
    elif count == 3:
        print(3)
    else:
        if S[1] == 'R':
            print(2)
        else:
            print(1)


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
b = 0
c = 0
for i in range(3):
    if a[i] == "R":
        b += 1
        if c < b:
            c = b
    else:
        b = 0
print(c)

Submission status: Accepted

Solution code:
weather = input()
if 'R' * 3 in weather:
  print(3)
elif 'R' * 2 in weather:
  print(2)
elif 'R' in weather:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
s = input()
if s[0:3] == "RRR":
  print(3)

elif s[0:2] == "RR" or s[1:3] == "RR":
  print(2)
  
elif s == "SSS":
  print(0)
  
else:
  print(1)

Submission status: Accepted

Solution code:
#A
import sys
s = input()

num = s.count("R")

if num >= 2:
    if s[1] == "S":
        num = 1

print(num)

Submission status: Accepted

Solution code:
S = str(input())

if S =="RRR":
  ans = 3
elif S =="SRR" or S == "RRS":
  ans = 2
else:
  S = list(S)
  if "R" in S:
    ans = 1
  else:
    ans = 0
print(ans)

Submission status: Accepted

Solution code:


import sys
from io import StringIO
import unittest

def resolve():
    a = input()
    # スペース区切りの整数の入力
    last = ''
    maxl = 0
    cons =0
    for s in a:
        if s=='R':
            cons = cons +1
            if maxl<cons:
                maxl = cons
        else:
            cons = 0

    # 出力
    print("{}".format(maxl))

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

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

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

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


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
a = 0
w = 0
for i in range(len(S)):
    if S[i] == 'R':
        w = w + 1
    else:
        if (w > a):
          a = w
        w = 0
if (w > a):
  a = w
print(a)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

Solution code:
s = input()

ans = 0
pre = 'R'
for i in s:
    if i == 'R' and pre == 'R':
        ans += 1
    elif i == 'R':
        ans = 1
    pre = i

print(ans)

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)
else:
  print(3)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


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


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29

DIV = (10**9) + 7
#DIV = 998244353

def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


def main():
    S =sRaw()
    S = S+"."
    nR = 0
    maxNR = 0
    for s in S:
        if s=="R":
            nR+=1
        else:
            maxNR = max(maxNR,nR)
            nR =0
    print (maxNR)

main()

Submission status: Accepted

Solution code:
A = input()
#A = list(map(int,input().split()))
max = 0
tmp = 0
for i in range(3):
    if A[i] == 'R':
        tmp += 1
    else :
        if max <= tmp:
            max = tmp
        tmp = 0
if max <= tmp:
    max = tmp
print(max)

Submission status: Accepted

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

S=list(input().rstrip('\n'))
res = 0
if S[0]=='R':
  res += 1
if S[1]=='S':
  if res == 0 and S[2]=='S':
    print(0)
  else:
    print(1)
else:
  res += 1
  if S[2]=='R':
    res += 1
    print(res)
  else:
    print(res)

Submission status: Accepted

Solution code:
s = list(input())
box = []
cnt = 0
for i in s:
	if i == 'R':
		cnt += 1
	else:
		box.append(cnt)
		cnt = 0
box.append(cnt)
print(max(box))

Submission status: Accepted

Solution code:
s = input()
import sys
ans = 0
for i in range(1, 4):
  if "R"*i in s:
    ans = i
print(ans)

Submission status: Accepted

Solution code:
S=input()

cnt=0
max_cnt=0
for s in S:
    if(s=="R"):
        cnt+=1
    else:
        cnt=0
    if(max_cnt<cnt):
        max_cnt=cnt

print(max_cnt)

Submission status: Accepted

Solution code:
S = input()
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

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

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

Submission status: Accepted

Solution code:
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:
a=input()

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

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.count('RRR') == 1:
  print(3)
elif s.count('RR') == 1:
  print(2)
elif s.count('R') != 0:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
s = input()

ans = 0
f = False
for i in range(len(s)):
    if (s[i] == "R"):
        if (f == True):
            ans += 1
        else:
            ans = 1
        f = True
    else:
        f = False

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(str(input()))
max1 = 0
now_max = 0
for i in S:
    if i == "R":
        max1 += 1
        if now_max < max1:
            now_max = max1
    elif i == "S":
        if now_max < max1:
            now_max = max1
        max1 = 0

print(now_max)

Submission status: Accepted

Solution code:
S = input()


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Rainy Season

def main(s):
    if s == 'RRR':
        return 3
    if 'RR' in s:
        return 2
    if 'R' in s:
        return 1
    return 0

s = input()
print(main(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
S = input()
ans = 0

if S == "RRR":
    print(3)
    sys.exit()
elif (S[:2]=="RR" or S[1:] == "RR"):
    print(2)
    sys.exit()
elif (S[0] == "R" or S[1] == "R" or S[2] == "R"):
    print(1)
    sys.exit()
else:
    print(0)

Submission status: Accepted

Solution code:

s = input()
temp = 0
ans = 0
for i in s:
    if(i == "R"):
        temp += 1
    else:
        if(temp > ans):
            ans = temp
            temp = 0
if(temp > ans):
    ans = temp
print(ans)

Submission status: Accepted

Solution code:
"""
int(input())
map(int, input().split())
list(map(int, input().split()))
input()
input().split()
"""

s = input()
cnt = 0
for i in range(3):
    if s[i]=='R':
        cnt += 1
if (s[1]=='S' and cnt != 0):
    print(1)
    exit()
else:
    print(cnt)

Submission status: Accepted

Solution code:
s = input()
a=0
if "R" in s:
  a = 1
  if "RR" in s:
    a += 1
    if "RRR" in s:
      a += 1
print(a)

Submission status: Accepted

Solution code:
S=input()
d=0
c=0
for i in range(len(S)):
  if S[i]=='S':
    c=0
  else:
    c+=1
  if c>d:
    d=c
print(d)

Submission status: Accepted

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

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

def main():
    s = input()
    max_val = 0
    val = 0
    for i in range(3):
        if s[i] == 'S':
            val = 0
        else:
            val += 1
        max_val = max(max_val, val)
    print(max_val)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
a = s[0:1]
b = s[1:2]
c = s[2:3]
ans = 0
if a == 'R' and b == 'R' and c == 'R':
  ans = 3
elif (a=='R' and b=='R') or (b=='R' and c=='R'):
  ans = 2
elif a=='R' or b=='R' or c=='R':
  ans = 1
print(ans)

Submission status: Accepted

Solution code:
s = input()
for i in ['RRR','RR','R']:
    if i in s:
        print(len(i));break
else:
    print(0)

Submission status: Accepted

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

for s in S:
    if s == 'R':
        tmp += 1
        ans = max(ans,tmp)
    elif s == 'S':
        tmp = 0
        ans = max(ans,tmp)
print(ans)

Submission status: Accepted

Solution code:
a, b, c = input()

if a == 'S' and b == 'S' and c == 'S':
  print(0)
  
elif a == 'R' and b == 'R' and c == 'R':
  print(3)
  
elif b == 'S' and a == 'R':
  print(1)
  
elif b == 'S' and c == 'R':
  print(1)
  
elif a == 'S' and b == 'R' and c == 'S':
  print(1)
  
else:
  print(2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()
r = 0
con = False
for c in str:
	if c == "S":
		con = False
	elif c == "R" and con == False:
		r = 1
		con = True
	elif c == "R" and con == True:
		r += 1
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import groupby

S = input()
groups = groupby(S)

ans = 0
for k,v in groups:
  if k=="R":
    ans = max(ans, len([e for e in v ]))

print(ans)

Submission status: Accepted

Solution code:
S=str(input())
if S=='RRR':
    print(3)
if S=='RRS':
    print(2)
if S=='RSR':
    print(1)
if S=='SRR':
    print(2)
if S=='RSS':
    print(1)
if S=='SRS':
    print(1)
if S=='SSR':
    print(1)
if S=='SSS':
    print(0)

Submission status: Accepted

Solution code:
a1 = input()

count = 0
max = 0
for i in a1:
  if i == "R":
    count += 1
    max = count
  elif i == "S":
    count = 0

print(max)

Submission status: Accepted

Solution code:
S = input()
if S == "RRR":
    print(3)
elif 'R' not in S:
    print(0)
elif S in ['SSR', 'SRS', 'RSS', 'RSR']:
    print(1)
else:
    print(2)