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:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    S = Scanner.string()
    if S == 'RRR':
        print(3)
    elif 'RR' in S:
        print(2)
    elif 'R' in S:
        print(1)
    else:
        print(0)


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
x = 0
for s in S:
    if s == "R":
        x += 1
    else:
        x = 0
    ans = max(ans,x)
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:
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()

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

    print(ans)


if __name__ == "__main__":
    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] == 'S' and s[1] == 'S' and s[2] == 'S':
    print('0')
    
elif s.count('R') == 2 and (s[0] == 'S' or s[2] == 'S'):
    print('2')

else:
    print('1')

Submission status: Accepted

Solution code:
S = input()
 
ans = 0
c = []
 
for i in range(len(S)):
    if S[i] =="R":
        ans += 1
    else:
        c.append(ans)
        ans = 0

c.append(ans)
 
print(max(c))

Submission status: Accepted

Solution code:
x = input()
a = [int(x[i]=='R') for i in range(3)]
s = sum(a)
if(s==2 and a[1]==0):
  s = 1
print(s)

Submission status: Accepted

Solution code:
S = input()

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

print(r)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def ii(): return int(input())
def mi(): return map(int, input().split())
def li(): return list(mi())


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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
s = input().strip()
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 = 1 if 'R' in s else 0
if s[0] == s[1] == 'R':
    ans += 1
if s[1] == s[2] == 'R':
    ans += 1
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
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
for i in range(3):
    if s[i]=='R':
        c=1
        j=i+1
        while j<3 and s[j]=='R':
            c+=1
            j+=1
        ans=max(ans,c)

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

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:
def main():
    S = input()
    ans = 0
    seq = 0
    for c in S:
        if c == "R":
            seq += 1
            ans = max(seq, ans)
        else:
            seq = 0
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
in_data = list(input())
if in_data[0] == "R":
    if in_data[1] == "R":
        if in_data[2] == "R":
            print("3")
        else:
            print("2")
    else:
        print("1")
elif in_data[0] == "S":
    if in_data[1] == "R":
        if in_data[2] == "R":
            print("2")
        else:
            print("1")
    elif in_data[1] == "S":
        if in_data[2] == "R":
            print("1")
        else:
            print("0")

Submission status: Accepted

Solution code:
s = input("")
n = 0

if s[0] == "R":
    if s[1] == "R":
        if s[2] == "R":
            n = 3
        else:
            n = 2
    else:
        n = 1

elif s[1] == "R":
    if s[2] == "R":
        n = 2
    else:
        n = 1

elif s[2] == "R":
    n = 1

else:
    n = 0

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
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:
s=input()
count=0
max=0
for i in range(len(s)):
  if s[i]=='R':
    count+=1
    max=count
  elif s[i]=='S':
    count=0
      
print(max)

Submission status: Accepted

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

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 bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
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())
s = S()
ans = 0
max_R = 0
for c in s:
    if c == 'R':
        max_R += 1
        ans = max(ans, max_R)
    else:
        max_R = 0
print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    s = S()
    cnt = 0
    first_done = False
    cont = True
    for c in s:
        if c == 'R' and cont:
            cnt += 1
            first_done = True
        else:
            if not first_done:
                continue
            else:
                cont = False
    print(cnt)


main()

Submission status: Accepted

Solution code:
s = input()

for i in [3, 2, 1, 0]:
    if 'R'*i in s:
        print(i)
        break

Submission status: Accepted

Solution code:
s=input()
p=0
for i in s:
    if i=="R":
        p+=1
    if i=="S" and p>0:
        break
print(p)

Submission status: Accepted

Solution code:
#------------------------template--------------------------#
import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import*
from io import BytesIO, IOBase
def vsInput():
    sys.stdin = open('input.txt', 'r')
    sys.stdout = open('output.txt', 'w')
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")
ALPHA='abcdefghijklmnopqrstuvwxyz'
M=10**9+7
EPS=1e-6
def value():return tuple(map(int,input().split()))
def array():return [int(i) for i in input().split()]
def Int():return int(input())
def Str():return input()
def arrayS():return [i for i in input().split()]


#-------------------------code---------------------------#
#vsInput()


s=list(input().split('S'))

# print(s)

ans=0
for i in s:
    ans=max(len(i),ans)

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()
renzoku = 0
res = []
for i in range(3):
    if s[i] == "R":
        renzoku += 1
    else:
        renzoku = 0
    res.append(renzoku)
print(max(res))

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

count = 0
max_count =0
for i in range(3):
    if a[i] == "S":
        count = 0
    elif a[i] == "R":
        count = count + 1
    if max_count <count:
        max_count = count

print(max_count)

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:
from sys import stdin
input = stdin.readline

s = input()
a = b = c = 0
a = (s[0] == 'R') * 1
b = (s[1] == 'R') * (1 + a)
c = (s[2] == 'R') * (1 + b)
print(max(a, b, c))

Submission status: Accepted

Solution code:
s=input()
ans=0
ren=False
for i in s:
  if i=="R":
    if ren:
      ans+=1
    else:
      ans=1
      ren=True
  else:
    ren=False
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = input().rstrip()
rainyDays = sum([c=="R" for c in weather])
if weather[1] == "S":
  rainyDays = min(rainyDays, 1)
print(rainyDays)

Submission status: Accepted

Solution code:
import os
import heapq
import sys,threading
import math
import bisect
import operator
from collections import defaultdict
sys.setrecursionlimit(10**5)
from io import BytesIO, IOBase
def gcd(a,b):
    if b==0:

        return a
    else:
        return gcd(b,a%b)
def power(x, p,m):
    res = 1
    while p:
        if p & 1:
            res = (res * x) % m
        x = (x * x) % m
        p >>= 1
    return res
def inar():
    return [int(k) for k in input().split()]

def lcm(num1,num2):
    return (num1*num2)//gcd(num1,num2)

def main():
    #t=int(input())
    t=1
    for _ in range(t):
        st=input()
        c=0
        ans=0
        res=0
        for i in range(3):
            if c==0 and st[i]=="R":
                c=1
                ans+=1
                continue
            if c==1 and st[i]=="R":
                ans+=1
            else:
                res=max(res,ans)
                ans=0
        res=max(res,ans)
        print(res)





BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

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

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

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

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

if __name__ == "__main__":
    main()
    #threadin.Thread(target=main).start()

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 175
# A - Rainy Season

S=input()

ans=0
count=0

if S[0]=="R":
    count=1

for i in range (1,len(S)):
    if S[i]=="R":
        if count>0:
            pass
        else:
            count=1
        if S[i-1]=="R":
            count+=1
        else:
            if count>ans:
                ans=count
                count=0
else:
    if count>ans:
        ans=count

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:
##175
##A - Rainy Season
S = str(input())
if "R" in S:
    if S[1] == "S":
        print(1)
    else:
        if S[0] == "R" and S[2] == "R":
            print(3)
        else:
            if S[0] == "S" and S[2] == "S":
                print(1)
            else:
                print(2)
    
else:
    print(0)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def getContinueRainDay(weathers):
  maxChainNum = 0
  nowChainNum = 0
  preDayRain = True

  for weather in list(weathers):
    if weather == "S":
      maxChainNum = nowChainNum if maxChainNum < nowChainNum else maxChainNum
      nowChainNum = 0
      preDayRain = False
    else:
      nowChainNum = nowChainNum+1 if preDayRain else 1
      preDayRain = True
  
  maxChainNum = nowChainNum if maxChainNum < nowChainNum else maxChainNum

  return maxChainNum

if __name__ == "__main__":
  S = input()
  print (getContinueRainDay(S))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    S = input()
    num = S.count('S')
    if num==3:
        print('0')
    if num==2: 
        print('1')
    if num==1:
        if S[1]=='S':
            print('1')
        else:
            print('2')
    if num==0:
        print('3')
        


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S.count('R') != 2:
    print(S.count('R'))
elif S.count('RR') == 1:
    print(2)
else:
    print(1)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

ans = 0

if S == "RRR":
    ans = 3
elif S == "RRS":
    ans = 2
elif S == "RSR":
    ans = 1
elif S == "RSS":
    ans = 1
elif S == "SRR":
    ans = 2
elif S == "SRS":
    ans = 1
elif S == "SSR":
    ans = 1
elif S == "SSS":
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = 0
temp = 0

for c in s :
  if c == 'S' :
    temp = 0
  else :
    temp += 1
    if temp > ans :
      ans = temp

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
count = 0

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

Submission status: Accepted

Solution code:
s=list(input())
s=[str(x) for x in s]
count=0
num=[0]
for i in range(len(s)):
  if (s[i]=='R'):
    count+=1
    num.append(count)
  elif (s[i]=='S'):
    count=0
    
print(max(num))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input().split("S")
ans=0
for i in S:
  ans=max(ans,len(i))
print(ans)
#これ思いつく人すごいなぁ

Submission status: Accepted

Solution code:

s = str(input())
r = 0
a = s.find("R")
if a==-1:
    print(r)
else:
    r+=1
    if a<2:
        while(s[a+1]=="R"):
            r+=1
            a+=1
            if a==2:
                break
    print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
res = 0
if s == "RSR":
    print(1)
    exit()
for i in range(3):
    if s[i] == "R":
        res += 1
print(res)

Submission status: Accepted

Solution code:
s=input()
ans=0

for i in range(1,4):
  r="R"*i
  if r in s:
    ans=i
print(ans)

Submission status: Accepted

Solution code:
s = input()

print(max([len(elem) for elem in s.split('S')]))

Submission status: Accepted

Solution code:
s = input()

rain = 0
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str=input()
flag=0
ans=0

for w in str:
    if w == 'R':
        flag+=1
        if (flag>ans):
            ans=flag
    else:
        flag = 0

print(ans)

Submission status: Accepted

Solution code:
print(max(map(len, input().split('S'))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

cont=0

if s[0]=="R" and s[1]=="R" and s[2]=="R":
    cont=3
elif s[0]=="R" and s[1]=="R":
    cont=2
elif s[1]=="R" and s[2]=="R":
    cont=2

elif s[0]=="R" or s[1]=="R" or s[2]=="R":
    cont=1
else:
    cont=0
print(cont)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
Sc=S.count("R")
SSc=S.count("RR")
if Sc==3:
  print(3)
elif SSc==1:
  print(2)
elif Sc==0:
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

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

S = str(input())

count = 0
max_count = 0
for i in range(3):
    if S[i] == 'R':
        if i >= 1 and S[i-1] == 'R':
            count += 1
        else:
            count = 1
    max_count = max(count,max_count)

print(max_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
count=0
for i in S:
    if i=='R':
        count+=1
if S=="RSR":
    count-=1
print(count)

Submission status: Accepted

Solution code:
s = input()
ans = s.count("R")
if s == "RSR":
    ans -= 1
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 'RRR' in S:
  print(3)
  exit()
if 'RR' in S:
  print(2)
  exit()
if 'R' in S:
  print(1)
  exit()
print(0)

Submission status: Accepted

Solution code:
S = str(input())

before = None
count = 0
for v in list(S):
    if (v == "R"):
        if (count == 0):
            count = 1
        if (before == v):
            count = count + 1
    before = v

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = 0
if S == "RRR":
    ans = 3
elif S[:2] == "RR" or S[1:] == "RR":
    ans = 2
elif S[0] == "R" or S[1] == "R" or S[2] == "R":
    ans = 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
s = input().split('S')
max = 0
for t in s:
  if max < len(t):
    max = len(t)
print(max)

Submission status: Accepted

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


def main():
    s = input().rstrip()
    rs = s.split("S")
    print(len(max(rs)))


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
cnt = 0
if S[0] == 'R' and S[1] == 'R' and S[2] == 'R':
    cnt = 3
else:
    if S.count('R') == 2:
        for i in range(2):
            if S[i] == 'R' and S[i+1] == 'R':
                cnt = 2
                break
            elif S[i] != S[i+1] and S[i+1] != S[i+2]:
                cnt = 1
                break
    if S.count('R') == 1:
        cnt = 1
print(cnt)

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

Submission status: Accepted

Solution code:
s=input()
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().split("S")
print(len(max(s)))

Submission status: Accepted

Solution code:
S = input()

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

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 == "RRR":
    print(3)
elif s == "SSS":
    print(0)
elif s == "RSS" or s == "SRS" or s == "SSR" or s == "RSR":
    print(1)
else:
    print(2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**8)
from bisect import bisect_left
from itertools import product
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def LF(): return list(map(float, input().split()))
def LC(): return [c for c in input().split()]
def LLI(n): return [LI() for _ in range(n)]
def NSTR(n): return [input() for _ in range(n)]

def array2d(N, M, initial=0):
    return [[initial]*M for _ in range(N)]

def copy2d(orig, N, M):
    ret = array2d(N, M)
    for i in range(N):
        for j in range(M):
            ret[i][j] = orig[i][j]
    return ret


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


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


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()
count = 0
ans = 0

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

Submission status: Accepted

Solution code:
a=input()

c=3

while True:
    
    if "R"*c in a :
        print(c) 
        break
        
    c-=1