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':
    ans = 3
elif 'RR' in S:
    ans = 2
elif 'R' in S:
    ans = 1
else:
    ans = 0
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

rains = input()



max_r = 0
r_count = 0

for i in range(len(rains)):
    if rains[i] == "R":
        r_count += 1
    else:
        r_count = 0
    if max_r < r_count:
        max_r = r_count

print(max_r)

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

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

if N=="SRR" or N=="RRS" :
    print("2")
    exit()

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

print("1")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
cnt = 0
ans = 0
for i in s:
    if i == "R":
        cnt += 1
        if ans < cnt:
            ans = cnt
    if i != "R":
        cnt = 0

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = list(input())

count = 0
max_count = 0
for s in S:
    if s == "R":
        count += 1
    else:
        if max_count < count:
            max_count = count
        count = 0
if max_count < count:
    max_count = count
print(max_count)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

s = readline().decode().rstrip()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
#import functools
#import operator
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as comb_with
#from itertools import permutations as perm
#import collections as C #most_common
#import math
#import sympy

#N = int(input())
#N,K,d= map(int,input().split())
#A = list(map(int,input().split()))
s = str(input())
#T = str(input())
c,C=0,0

for i in s:
    if i=='R':
        c+=1

    else:
        C=max(c,C)
        c=0

print(max(C,c))

Submission status: Accepted

Solution code:
S = input()
count = 0
result = 0

for i in range(3):
    if S[i] == 'S':
        count = 0
    else:
        count += 1
    if count > result:
        result = count

print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

count = 0
m = 0

for s in S:
    if s == "R":
        count += 1
    else:
        m = max(m, count)
        count = 0
m = max(m, count)

print(m)

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 == '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[0] == "R" and S[1] == "R" and S[2] == "R":
    print(3)
    exit()

if S[0] == "R" and S[1] == "R":
    print(2)
    exit()

if S[1] == "R" and S[2] == "R":
    print(2)
    exit()

if "R" in S:
    print(1)
    exit()

print(0)

Submission status: Accepted

Solution code:
S = input()

print(("R" in S) + ("RR" in S) + ("RRR" in S))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    s = input().strip()
    ans = 0
    for l in range(4):
        p = "R" * l
        if s.find(p) >= 0:
            ans = max(ans, l)
    print(ans)

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:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest
import os

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 実装を行う関数
def resolve(test_def_name=""):
    x = input()

    if x.__contains__("RRR"):
        print(3)
        return
    if x.__contains__("RR"):
        print(2)
        return

    if x.__contains__("R"):
        print(1)
        return

    print(0)
    return


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """RRS"""
        output = """2"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """SSS"""
        output = """0"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """RSR"""
        output = """1"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# /usr/bin/python3
# -*- coding: utf-8 -*-
from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key
from bisect import bisect_left


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


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

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

def bindex(a,x):
    i = bisect_left(a,x)
    if i != len(a) and a[i] == x:
        return i
    return None

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    S = input()

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

Submission status: Accepted

Solution code:


S = input()

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

count = 0
maxC = 0
for c in s:
    if c == 'R':
        count += 1
        maxC = max(count, maxC)
    else:
        count = 0
print(maxC)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
s = str(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()
if S == 'SRR' or S == 'RRS':
    ans = 2
elif S == 'RRR':
    ans = 3
elif S == 'SSS':
    ans = 0
else:
    ans = 1
print(ans)

Submission status: Accepted

Solution code:
S = input()
print(max([len(i) for i in S.split("S")]))

Submission status: Accepted

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

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 == 'SSS':
  print(0)
elif s == 'SRR' or s == 'RRS':
  print(2)
elif s == 'RRR':
  print(3)
else:
  print(1)

Submission status: Accepted

Solution code:
# for #!/usr/bin/env python
import os
import sys
from io import BytesIO, IOBase


# region fastio

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

# endregion
class union_find:
    def __init__(self, n):
        self.n = n
        self.rank = [0]*n
        self.parent = [int(j) for j in range(n)]
    
    def union(self,i,j):
        i = self.find(i)
        j = self.find(j)
        if self.rank[i] == self.rank[j]:
            self.parent[i] = j
            self.rank[j] += 1

        elif self.rank[i] > self.rank[j]:
            self.parent[j] = i
        else:
            self.parent[i] = j

    def find(self, i):
        temp = i
        if self.parent[temp] != temp:
            self.parent[temp] = self.find(self.parent[temp])
        return self.parent[temp]
from math import log2, ceil
from collections import deque, Counter as CC, defaultdict as dd
MOD = int(1e9+7)
def main():
# Enter your code here. Read input from STDIN. Print output to STDOUT
    # for t in range(int(input())):
        
        # n = int(input())
        s = input()
        ans = 0
        ct = 0
        for i in range(3):
            if(s[i]=='R'):
                ct+=1
            else:
                ans = max(ct, ans)
                ct = 0
        ans = max(ct, ans)
        print(ans)
        # l  = [(int(j),ct) for ct,j in enumerate(input().split())]











        



if __name__ == "__main__":
    main()

Submission status: Accepted

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


    for i in range(len(s)):
        if s[i] == "R":
            tmp += 1
    if tmp == 3:
        print(3)
    elif tmp == 2:
        if s[1] == "S":
            print(1)
        else:
            print(2)
    elif tmp == 1:
        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 == "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 == 'SSR':
    print(1)
elif s == 'SRS':
    print(1)
elif s == 'RSS':
    print(1)
elif s == 'RSR':
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in s:
    if i == 'R':
        ans += 1
    elif ans != 0 and i == 'S':
        break
print(ans)

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    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


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
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)

    divisors.sort()
    return divisors

inf = 10 ** 18
mod = 10 ** 9 + 7

s = sr()
if s[0] == s[1] == s[2] == 'R':
    print(3)
elif s[0] == s[1] == 'R' or s[1] == s[2] == 'R':
    print(2)
elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R':
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys, math
import io, os
#data = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline
from bisect import bisect_left as bl, bisect_right as br, insort
from heapq import heapify, heappush, heappop
from collections import defaultdict as dd, deque, Counter
#from itertools import permutations,combinations
def data(): return sys.stdin.readline().strip()
def mdata(): return list(map(int, data().split()))
def outl(var) : sys.stdout.write('\n'.join(map(str, var))+'\n')
def out(var) : sys.stdout.write(str(var)+'\n')
from decimal import Decimal
from fractions import Fraction
#sys.setrecursionlimit(100000)
INF = float('inf')
mod = int(1e9)+7


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

Submission status: Accepted

Solution code:
import copy
import math
import time
import statistics
import math
import itertools
import bisect
from decimal import *

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    start = time.time()

    #n, q = get_int_multi()
    #n = get_int()

    s = get_string()

    wk = 0
    ans = 0
    for a in s:
        if a == "R":
            wk += 1
        else:
            wk = 0
        ans = max(ans, wk)

    print(ans)



if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# This is a sample Python script.

# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.

s = input()

renzoku = 0
res = 0
for tenki in s:
    if tenki == "R":
        renzoku += 1
    else:
        renzoku = 0
    res = max(renzoku, res)
print(res)

Submission status: Accepted

Solution code:
import sys
import copy
from collections import deque
import collections
stdin = sys.stdin

mod = 10**9+7

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

s = ns()

if s[0]==s[1]==s[2]=='R':
    print(3)
    exit(0)

if s[0]==s[1]=='R' or s[1]==s[2]=='R':
    print(2)
    exit(0)

if 'R' in s:
    print(1)
    exit(0)

print(0)

Submission status: Accepted

Solution code:
l=list(input())
mx=0
t=0
for i in range(len(l)):
    if l[i]=='R':
        t+=1
    else:
        mx=max(mx,t)
        t=0
mx=max(mx,t)
print(mx)

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


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


def main():
    s = _s()
    if s[1] == "S":
        return 1 if "R" in s else 0
    else:
        return s.count("R")


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

Submission status: Accepted

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

input = sys.stdin.readline


def S():
    return input().rstrip()


def I():
    return int(input())


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


s = S()

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 bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
sys.setrecursionlimit(10**7)

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

def main():
    S = _S()
    daynum = S.count("R") if S!="RSR" else 1
    print(daynum)

main()

Submission status: Accepted

Solution code:
def main():
    X = input().strip()
    if X == "RRR":
        return 3
    if "RR" in X:
        return 2
    if "R" in X:
        return 1
    return 0


print(main())

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
from sys import stdin

def main():

    input = stdin.readline

    S = str(input())[:-1]

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input() + " "
ans = 0
cur = 0

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

print(ans)

Submission status: Accepted

Solution code:
#N = int(input())
S = str(input())
#A, B = map(int, input().split())
#C = list(map(int, input().split()))

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

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import math
def main():
    s = input()
    tmp = s.count("R")
    if(s[1]=="S" and tmp>=1):
        print(1)
    else:
        print(tmp)
if __name__ == '__main__':
    main()