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

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

print(cntmax)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = str(input())

if S[0] == "S":
  if S[1] == "S":
    if S[2] == "S":
      print(0)
    else:
      print(1)
  else:
    if S[2] == "S":
      print(1)
    else:
      print(2)
else:
   if S[1] == "S":
    if S[2] == "S":
      print(1)
    else:
      print(1)
   else:
    if S[2] == "S":
      print(2)
    else:
      print(3)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

ans = 0
hoge = 0
for i in range(3):
    if s[i] == "R":
        hoge += 1
    else:
        if hoge > ans:
            ans = hoge
        hoge = 0
    if i == 2:
        if hoge > ans:
            ans = hoge
        hoge = 0
print(ans)

Submission status: Accepted

Solution code:
Word = input()

counter=0
maxc = 0

for i in range(len(Word)):
    if 'R'==Word[i]:
        counter +=1
        maxc = max(counter, maxc)
    else:
        counter=0
print(maxc)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0
ans = []
for s in S:
    if s == "R":
        cnt += 1
    else:
        ans.append(cnt)
        cnt = 0
ans.append(cnt)
print(max(ans))

Submission status: Accepted

Solution code:
s=input()


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ws = input()

if ws.count('S') == 3:
    print(0)
elif ws.count('S') == 2:
    print(1)
elif ws.count('S') == 1:
    if ws.index('S') == 1:
        print(1)
    else:
        print(2)
else:
    print(3)

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:
s=input()
ans=0
m=0
for i in range(3):
    if s[i]=="R":
        m+=1
    else:
        ans=max(m,ans)
        m=0
ans=max(m,ans)
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    s = S()
    if s == ['R', 'S', 'R']:
        print(1)
    else:
        print(s.count('R'))
    return


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
N = input()
cons = 0
flag = 0
for i in range(len(N)):
    if (N[i]=='S'):
        flag = 0
        if cons>=1:
            print(cons)
            exit(0)
    else:
        flag = 1
        cons += 1
print(cons)

Submission status: Accepted

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

S = readline().strip()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    tenki = input()
    leng = len(tenki)

    count = 0
    lst = []
    for i in range(leng):
        if tenki[i] == "R":
            count += 1
        else:
            lst.append(count)
            count = 0
    lst.append(count)
    count = 0
    print(max(lst))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import re

S = input()

rrr = S.count("RRR")
rr = S.count("RR")
r = S.count("R")

if rrr == 1:
    print(3)
elif rr == 1:
    print(2)
elif r == 1 or r == 2:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    S = input()
    ans = 0
    if S[0] == 'R' and S[1] == 'R' and S[2] == 'R':
        ans = 3
    elif (S[0] == 'R' and S[1] == 'R') or S[1] == 'R' and S[2] == 'R':
        ans = 2
    elif 'R' in S:
        ans = 1
    else:
        ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
renzoku = 0

S = input()

for i, weather in enumerate(S):
    if not weather == "R":
        continue
    if renzoku == 0: renzoku += 1
    try:
        if S[i+1] == "R":
            renzoku += 1
    except:
        continue

print(renzoku)

Submission status: Accepted

Solution code:
a = list(input())
total = 0
if a[0] == "R":
    total += 1
    if a[1] == "R":
        total += 1
        if a[2] == "R":
            total += 1
elif a[1] == "R":
    total += 1
    if a[2] == "R":
        total += 1
elif a[2] == "R":
    total += 1
print(total)

Submission status: Accepted

Solution code:
S = str(input())
answer = list()
answer.append(['SSS'])
answer.append(['SRS', 'RSR', 'SSR', 'RSS'])
answer.append(['RRS', 'SRR'])
answer.append(['RRR'])
for i in range(len(answer)):
    if S in answer[i]:
        print(i)

Submission status: Accepted

Solution code:
s = input()
ans = 0
for i in range(3):
  if s[i]=="R":
    temp = 1
    count = i
    flg=False
    while count<3 and s[count]=="R":
      flg=True
      temp+=1
      count+=1
    if flg:
      temp-=1
    ans = max(ans, temp)
print(ans)

Submission status: Accepted

Solution code:
a = input()

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

Submission status: Accepted

Solution code:
x=input()
a=x.find('R')
b=x.find('RR')
c=x.find('RRR')
if c>=0:
  print(3)
elif b>=0:
  print(2)
elif a>=0:
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input().strip("¥n")

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 == 'RSR':
    print(1)
elif s == 'SRS':
    print(1)
else:
    ans = s.count('R')
    print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
S = input()

if ( S[0]=='R' ):
  # R
  if ( S[1]=='R' ):
    # RR
    if ( S[2]=='R' ):
      # RRR
      print(3)
    else:
      # RRS
      print(2)
  else:
    # RS_
    print(1)
# 0
else:
  if ( S[1]=='R' ):
    # SR
    if ( S[2]=='R' ):
      # SRR
      print(2)
    else:
      # SRS
      print(1)
  else:
    # SS
    if ( S[2]=='R' ):
      # SSR
      print(1)
    else:
      # SSS
      print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    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)
resolve()

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

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'R':
    if s[1] == 'R':
        if s[2] == 'R':
            print(3)
        else:
            print(2)
    else:
        if s[2]:
            print(1)
        else:
            print(0)
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:
#!/usr/bin/env python3
S = input()

if S=='RRR':
    print(3)
elif S=='RRS' or S=='SRR':
    print(2)
elif S.count('R') == 1 or S=='RSR':
    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 == 'RSR' or s =='SRS' or s == 'SSR' or s == 'RSS':
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
s = input()

if s.count('S') == 0:
    print(3)
elif s[:2] == 'RR' or s[1:3] == 'RR':
    print(2)
elif s[0] == 'R' and s[2] == 'R':
    print(1)
elif s.count('R') == 1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')
# from math import ceil, floor, log2
# from collections import deque
# from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product, permutations
# from heapq import heapify, heappop, heappush
# import numpy as np    # cumsum
# from bisect import bisect_left, bisect_right

def solve():
    S = input()
    L = S.split('S')
    ans = 0
    for l in L:
        ans = max(ans, len(l))
    print(ans)



if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
s = input()

ans = 0

if s.count("R") == 2:
    if s.count("RSR") == 1:
        ans = 1
    else:
        ans = 2
else:
    ans = s.count("R")

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

T = input()

mae=""
ans=""
for i in range(3):
    if i==0:
        if T[i]=="R":
            mae=T[i]
            ans+=T[i]
    elif i>0:
        if mae=="R" and T[i]=="R":
            ans+=T[i]
        elif mae!="R" and T[i]=="R":
            ans=T[i]
        mae=T[i]
print(len(ans))

Submission status: Accepted

Solution code:
s = input()

if s=='RRR':print(3)
if s=='SSS':print(0)

if s=='RRS':print(2)
if s=='SSR':print(1)

if s=='RSR':print(1)
if s=='SRS':print(1)

if s=='SRR':print(2)
if s=='RSS':print(1)

Submission status: Accepted

Solution code:
def resolve():
    s = input()
    out = 0
    l = []
    for i in range(3):
        if s[i] == 'R':
            out += 1
        elif s[i] == 'S':
            l.append(out)
            out = 0
    l.append(out)
    print(max(l))
resolve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


def b():
    pass



def c():
    pass



def d():
    pass


a()
# b()
# c()
# d()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-------------------- fast io --------------------
import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0
 
    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None
 
    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()
 
    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()
 
    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)
 
 
class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")
 
 
sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")
 
# ------------------- fast io --------------------

from math import gcd, ceil

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

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

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

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

s = input()
ans = 0
if s[0] == 'R' or s[2] == 'R' or s[1] == 'R':
    ans = 1
if (s[0] == 'R' and s[1] == 'R') or (s[1] == 'R' and s[2] == 'R'):
    ans = 2
if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
    ans = 3
print(ans)

Submission status: Accepted

Solution code:
S = input()
cnt = 0
cnt_max = 0

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

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

r = s.count("R")

if r == 3:
  print(3)
elif r == 2:
  if s[1] == "S":
    print(1)
  else:
    print(2)
elif r == 1:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
s = input()
c = s.count("R")
if c==3:
    print(3)
elif c==2:
    if s[0]==s[1]=="R" or s[1]==s[2]=="R":
        print(2)
    else:
        print(1)
elif c==1:
    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:
from re import search

s = input()
m = search(r'R+', s)

print(len(m.group()) if m is not None else 0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
maxCount = 0
count = 0

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

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 = list(input())
if s[0] == "R":
    if s[1] == "R":
        if s[2] == "R":
            print(3)
        else:
            print(2)
    else:
        print(1)
elif 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:
S = list(input())
ans = 0

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

Submission status: Accepted

Solution code:
string = input()

count = 0
cont = True

for s in string:
    if s == 'R':
        if cont:
            count += 1
        else:
            count = 1
        cont = True
    else:
        cont = False

print(count)

Submission status: Accepted

Solution code:
#<ABC175>
#<A>
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#! coding:utf-8

import numpy as np

weather = input()
w_temp = 0
w_sum = 0

for i in range(len(weather)):
    if weather[i] == "R":
        w_temp += 1
    else:
        if w_sum < w_temp:
            w_sum = w_temp
        w_temp = 0

if w_sum < w_temp:
    w_sum = w_temp

print(str(w_sum))

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=="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 == 'RSS' or S == 'SSR' or S == 'SRS' or S == 'RSR':
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
from itertools import groupby

ans = 0
for k, it in groupby(input()):
    if k == "R":
        ans = max(ans, len(list(it)))
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 = str(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:
s = list(input())

if 'S' not in s:
  print(3)

elif 'R' not in s:
  print(0)

elif s.count('S') == 2:
  print(1)

else:
  if s.index('S') == 1:
    print(1)
  else:
    print(2)

Submission status: Accepted

Solution code:
def main():
    s = input()
    r = s.count('R')
    if r in [0,1,3]:
        print(r)
    else:
        if s[0] == s[1] or s[1] == s[2]:
            print(2)
        else:
            print(1)
            
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = str(input())
cnt = 0
cnt1 = 0
for i in range(len(S)):
    if S[i] == "R":
        cnt += 1
    if S[i] == "S":
        cnt1 = max(cnt,cnt1)
        cnt = 0
if cnt > cnt1:
    print(cnt)
else:
    print(cnt1)

Submission status: Accepted

Solution code:
a=input()
b=a.split('S')
ans=0
for i in b:
    if len(i)>ans:
        ans=len(i)
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = input()
if 'R' not in A:
    print(0)
elif 'S' not in A:
    print(3)
elif 'RR' in A:
    print(2)
elif 'SS' or 'R' in A:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

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

import sys

sys.setrecursionlimit(10 ** 6)


S = input()

res = 0
if S == 'RSS' or S == 'SRS' or S == 'SSR' or S == 'RSR':
    res = 1
elif S == 'RRS' or S == 'SRR':
    res = 2
elif S == 'RRR':
    res = 3

print(res)

Submission status: Accepted

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

def main():
    S = input().rstrip()
    ans = 0
    cnt = 0
    isR = False
    for s in S:
        if s == 'R':
            if isR:
                cnt += 1
            else:
                cnt = 1
                isR = True
        else:
            isR = False
            ans = max(ans, cnt)
    ans = max(cnt, ans)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

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 = list(input())
count=0
if a.count('R')==3:
  print(3)
elif a.count('R')==1:
  print(1)
elif a.count('R')==0:
  print(0)
else:
  flag = True
  for i in range(1,3):
    if a[i]=='R':
      if a[i-1]=='R':
        print(2)
        flag =False
        break
  if flag==True:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
tmp = 0
preR = 0
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)
elif S == 'RRR':
    print(3)

Submission status: Accepted

Solution code:
S = input()

cnt = S.count('R')
if cnt == 1:
    print(cnt)
elif cnt == 0:
    print(cnt)
elif cnt == 3:
    print(cnt)
else:
    if S[1] == "S":
        print(1)
    else:
        print(cnt)

Submission status: Accepted

Solution code:
s = input()
iter = 0
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)
elif s[0] =="R"and s[2]=="R":
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

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

wea = list(input())
if wea[0] == "R":
  if wea[1] == "R":
    if wea[2] == "R":
      print(3)
    elif wea[2] == "S":
      print(2)
  elif wea[1] == "S":
    print(1)
elif wea[0] == "S":
  if wea[1] == "R":
    if wea[2] == "R":
      print(2)
    elif wea[2] == "S":
      print(1)
  elif wea[1] == "S":
    if wea[2] == "R":
      print(1)
    elif wea[2] == "S":
      print(0)

Submission status: Accepted

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

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

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S=input()
if S=="RSR":
    print(1)
else:
    
    print(len(S.replace("S","")))

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = 0
    if s[0] == 'R' and s[0] == s[1] and s[1] == s[2]:
        ans = 3
    elif s[0] == 'R' and s[0] == s[1]:
        ans = 2
    elif s[1] == 'R' and s[1] == s[2]:
        ans = 2
    elif 'R' in s:
        ans = 1
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import re

tex = str(input())

if tex == 'RRR':
  print(3)
elif re.search('RR',tex):
  print(2)
elif re.search('R', tex):
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

if S[2] == 'R':
    ans = 1
else:
    ans = 0
    

for i in range(2):
    if S[i] == 'R':
        ans = max(ans,1)
        if S[i + 1] == 'R':
            ans += 1

print(ans)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s =input()

ans =0
if s.count("R") == 2 :
  if  s.count("RR") == 1:
    ans = 2
  else:
    ans = 1
else:
  ans = s.count("R")
print(ans)

Submission status: Accepted

Solution code:
# 2020/08/15
# AtCoder Beginner Contest 175 - A

# Input
s = input()

# Calc
cnt = 0
for i in range(len(s)):
    if s[i] == 'R':
        cnt = cnt + 1

if cnt == 3:
    ans = 3
elif cnt == 2:
    if s[1] == 'S':
        ans = 1
    else:
        ans = 2
elif cnt == 1:
    ans = 1
else:
    ans = 0

# Output
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S= input()

if S.count('RRR') == 1:
    print(3)
elif S.count('RR') == 1:
    print(2)
elif S.count('RSR') == 1 or S.count('RSS') == 1 or S.count('SRS') == 1 or S.count('SSR') == 1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
line = input().rstrip()
count = 0


if 'R' in line:
  if line == 'RRR':
    print(3)
  elif line == 'RSR':
  	print(1)
  else:
    for i in range(3):
      if line[i] == 'R':
        count += 1
    print(count)
else:
  print(0)

Submission status: Accepted

Solution code:
S = input()
cnt = 0

if S[0] == 'R':
    cnt = 1
    if S[1] == 'R':
        cnt = 2    
        if S[2] == 'R':
            cnt = 3
else:
    if S[1] == 'R':
        cnt = 1
        if S[2] == 'R':
            cnt = 2
    elif S[2] == 'R':
        cnt = 1

print(cnt)