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:
import sys
import math
import collections
import decimal
import itertools
from collections import deque
from functools import reduce
import heapq
import copy
#k = int(input())
#n, k = map(int, sys.stdin.readline().split())
s = input()
#a = list(map(int, sys.stdin.readline().split()))


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
ansmax = 0
if S[0] == "R":
    ans += 1
if S[1] == "R":
    ans += 1
else:
    ansmax = ans
    ans = 0
if S[2] == "R":
    ans += 1

ansmax=max(ans,ansmax)
print(ansmax)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

day = 0
max_day = 0
for s in S:
    if s == 'R':
        day += 1
        max_day = max(day, max_day)
    else:
        day = 0

print(max_day)

Submission status: Accepted

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

def solve():
    S = readline().rstrip()

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

solve()

Submission status: Accepted

Solution code:
#ceilevenoddformula
import math
from queue import PriorityQueue
import bisect
import copy
import time
from collections import Counter
#map(int,input().split())
#int(x) for x in input().split()
x=input()
if x=='RRR':
	print(3)
elif 'RR' in x:
	print(2)
elif "R" in x:
	print(1)
else:
	print(0)

Submission status: Accepted

Solution code:

### ----------------
### ここから
### ----------------

import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    #n,m,k=map(int, readline().rstrip().split())
    #arr=list(map(int, readline().rstrip().split()))
    #n=int(readline())
    ss=readline().rstrip()

    if ss=="RRR":
        print(3)
    elif ss=="SSS":
        print(0)
    elif ss=="RRS":
        print(2)
    elif ss=="SRR":
        print(2)
    else:
        print(1)
    #yn(1)

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

### ----------------
### ここまで 
### ----------------

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter
S = input()

C = Counter(S)

if C["R"] == 2 and S == "RSR":
  print(1)
else:
  print(C["R"])

Submission status: Accepted

Solution code:
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    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
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

#maincode-------------------------------------------------
s = input()
ans = s.count('R')
if ans == 2 and s[1] != 'R':
    ans -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if(S=="RRR"):
  print(3)
elif(S=="RRS" or S=="SRR"):
  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 = list(input())
count = 0
tmp = 0

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

print(max(tmp, count))

Submission status: Accepted

Solution code:
"""MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWO:,'..'xXWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO. .:kOo.,kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO. .lNWWo..lXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MNOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMMMMWKxoloxKWNc  .:xxd;  ,dxxxkXMXkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMM
MKc''''''''''''''''.  ..'''''.   .''''.  .''MMMWx..,:. .xXo''.  .''.  ..'';kMk;'''''.  .'.''.  .''''''.  ..''.   .''MM
MWNXNNNNNNNNNNNNNNNO' ;KNNNNNKo. cKNNNd. lXNMMMK; ,0Wx. :NWXXl .dNNO' ;KNNNWMWNNNNNXc .kNNNNx. cXNNNNNO' ;KNN0; 'ONNMM
MMMMMMMMMMMMMMMMMWM0' :NMMMMWMX: .OMWWx. oWMMMMWx. ';. .dNMWWo .xMM0' :NWWMMMMMMMMWWl .OMMMWk. lWWMMWM0' ;XMMX: ,KMMMM
MMMMMMWMWkccccccccc;. :NMWNNNKd. :XMMWx. oWMMMWKo. .',. .,ldx; .dMM0' :NMMMMMMMNNWMWl .OMMMWk. lWMMMMM0' ;XMMX: ,0MMMM
MMWXKNWMWxcc,. .;cc;. :XMk,''..'lKWMMWx. oWMNx:. .lONNKxl.     .xMM0' :NMMMMMM0:,oKO' ,KMMMMk. lWWNkoc,. .;::;. ,KMMMM
MMXc.lXMMWWWNd..xWM0' :NM0;  ;kXWMMMWNl  oWMK:.;xXWWMWXx:. ,c' .dMM0' :NMMMMMMKc. ...;kWMMMMk. lWWc .:;. .clc:. ,KMMMM
MWWx. lXMWMMMK, lWM0' :NMMNx'.,ldxxoc'   oWMWNKNWWWN0o' .:kNWo .dMM0' :NMMMMMMMNO;  ,OWWWMMMk. lWM' lXx. lNMMX: ,KMMMM
MMMWk'.,xKNX0c..kWM0' :NMMMMNkl;,'',:l:  oWMMMMMWMWO' 'l0WMWWo .xMM0' :NMMMMMMMMMNd. .oXWMMMk. lWMd.....;0WMMX: ,KMMMM
MMMMWKo'...'..:kWMM0' :NMMMMMMMWWNNWWWx. oWMMMMMMMMWOxXWMWMWWo .xMM0' :NMMMMMMMMMMMKl. ,kNMMk. lWMWKkxx0NMWMMX: ,KMMMM
MMMMMMMN0kxk0XNWMMWKl;xNMMMMMMMMMMMMWM0c;kWMMMMMMMMMMMWWMMMMWk;:OMMXl,dNMMMMMMMMMMMMWO; .dNM0c;kWWMMMMMMMMMMMNd,oXMMMM
MMMMMMMMWWMWMMMMMMMMMWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWMMWWMMWMMMMMMMMMMMMMMNkxKWMMWWMMMMMMMMMMMMMMWMMWMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"""


#				 Author: Udit "luctivud" Gupta @ https://www.linkedin.com/in/udit-gupta-1b7863135/					 #


import math;   		from collections import *
import sys;   		from functools import reduce
import time;   		from itertools import groupby

# sys.setrecursionlimit(10**6)

def input()         : return sys.stdin.readline()
def get_ints()      : return map(int, input().strip().split())
def get_list()      : return list(get_ints())
def get_string()    : return list(input().strip().split())
def printxsp(*args) : return print(*args, end="")
def printsp(*args)  : return print(*args, end=" ")


DIRECTIONS = [(+0, +1), (+0, -1), (+1, +0), (+1, -1)] 
NEIGHBOURS = [(-1, -1), (-1, +0), (-1, +1), (+0, -1),\
              (+1, +1), (+1, +0), (+1, -1), (+0, +1)]



# MAIN >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

# for _test_ in range(int(input())): 
s = input()
g = groupby(s)
ans = 0
for ke, val in g:
	if ke == 'R':
		ans = max(ans, len(list(val)))
print(ans)

Submission status: Accepted

Solution code:
s = str(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:
def solve():
    s = input()
    ans = 0
    hoge = [0]
    for i in s:
        if i == "R":
            ans += 1
            hoge.append(ans)
        else:
            ans = 0
    print(max(hoge))
    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import sys
from io import StringIO
import unittest


def resolve():
    s = input()
    # n = int(input())
    # a, b = map(int, input().split())
    # l = [list(map(int, input().split())) for _ in range(n)]

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

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

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

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

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


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

Solution code:
S = input()

arr = S.split("S")


brr = [len(arr[i]) for i in range(len(arr))]


print(max(brr))

Submission status: Accepted

Solution code:
S = list(input())

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

print(ans)

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()
ans = 0
tmp = 0
for c in s:
    if c == 'R':
        tmp += 1
    else:
        tmp = 0
    ans = max(ans, tmp)
print(ans)

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from heapq import heappush, heappop, heapify

import itertools
import bisect
import math
import fractions
import sys
import copy


def L(): return sys.stdin.readline().split()


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


def SL(): return list(sys.stdin.readline().rstrip())


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


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


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


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


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


def LIR1(n): return [LI1() for _ in range(n)]


def SR(n): return [SL() for _ in range(n)]


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


def LR(n): return [L() for _ in range(n)]


def perm(n, r): return math.factorial(n) // math.factorial(r)


def comb(n, r): return math.factorial(
    n) // (math.factorial(r) * math.factorial(n-r))


alphabets = "abcdefghijklmnopqrstuvwxyz"
ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007
INF = float("inf")


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
count = 0
res = 0
for c in S:
    if c == 'S':
        count = 0
    else:
        count += 1
        res = max(res, count)
print(res)

Submission status: Accepted

Solution code:
import sys
import bisect
#t=int(input())
t=1
for _ in range(t):
    #r,g,b=map(int,input().split())
    #l=list(map(int,input().split()))
    #l2=list(map(int,input().split()))
    #n=int(input())
    #l=list(map(int,input().split()))
    r=0
    maxi=0
    s=input()
    for i in range(len(s)):
        if s[i]=='R':
            r+=1
        else:
            maxi=max(maxi,r)
            r=0
    maxi=max(maxi,r)
    print(maxi)

Submission status: Accepted

Solution code:
import sys
input = lambda:sys.stdin.readline().strip()
s = input()
ans = 0
i = 0
while i<len(s):
    if s[i]=='S':
        i+=1
        continue
    j = i
    while j<len(s) and s[j]=='R':
        j+=1
    ans = max(ans,j-i)
    i = j
print(ans)

Submission status: Accepted

Solution code:
S=input()
ans = S.count("R")
if ans == 2 and S[1] == "S":
  print(1)
else:
  print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    S = input()
    if S.count("RRR"):
        print(3)
    elif S.count("RR"):
        print(2)
    elif S.count("R"):
        print(1)
    else:
        print(0)


main()

Submission status: Accepted

Solution code:
import sys
import math
#from queue import *
#import random
#sys.setrecursionlimit(int(1e6))
input = sys.stdin.readline
 
############ ---- USER DEFINED INPUT FUNCTIONS ---- ############
def inp():
    return(int(input()))
def inara():
    return(list(map(int,input().split())))
def insr():
    s = input()
    return(list(s[:len(s) - 1]))
def invr():
    return(map(int,input().split()))
################################################################
############ ---- THE ACTUAL CODE STARTS BELOW ---- ############

x=input()

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    S = input().rstrip()
    if S == "RRR":
        print(3)
    elif S == "RRS":
        print(2)
    elif S == "SRR":
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0
max_cnt = 0

for s in S:
  if s == 'R':
    cnt += 1
    max_cnt = max(cnt, max_cnt)
  else:
    cnt = 0

print(max_cnt)

Submission status: Accepted

Solution code:
def main():
    s = input()
    c = 0
    ans = 0
    for si in s:
        if si == "R":
            c += 1
        else:
            c = 0
        ans = max(ans, c)
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
cnt = 0

if "RRR" in s:
    print(3)
    exit()
elif "RR" in s:
    print(2)
    exit()
elif "R" in s:
    print(1)
    exit()

else:
    print(0)

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

s = input()
cnt = 0
if s == "RRR":
    print(3)
elif s.count("R") == 1 or s == "RSR":
    print(1)
elif s == "SSS":
    print(0)
else:
    print(2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
# def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  s=S()
  if s.count('RRR')>0:
    return 3
  if s.count('RR')>0:
    return 2
  if s.count('R')>0:
    return 1
  return 0

# main()
print(main())

Submission status: Accepted

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

solve()

Submission status: Accepted

Solution code:
s = input()

cnt = 0
mx = 0

for si in s:
    if si == "R":
        cnt += 1
    else:
        cnt = 0
    if mx < cnt:
        mx = cnt

print(mx)

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

Submission status: Accepted

Solution code:
tmp = input()
if tmp == 'RRR':
    print(3)
elif tmp == 'RRS' or tmp == 'SRR':
    print(2)
elif tmp == '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()
ans = 0
for i in range(3, 0, -1):
    if 'R' * i in S:
        ans = i
        break
print(ans)

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 == "SSS":
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
s = str(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()

ans=0
temp=0

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

print(ans)

Submission status: Accepted

Solution code:
s = input()

if s.count("RRR") != 0:
    ans = 3
elif s.count("RR") != 0:
    ans = 2
elif s.count("R") != 0:
    ans = 1
else:
    ans = 0

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

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 bisect,collections,copy,heapq,itertools,math,string
from collections import defaultdict as D
from functools import reduce
import numpy as np
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

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

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353    

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

rain = 0
prev = "R"
max = -1
for i in range(len(s)):
    if s[i] == "R":
        rain+=1
    else:
        rain=0
    if rain > max:
        max = rain
print(max)

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

Submission status: Accepted

Solution code:
x = input()
count = 0
max = 0
for i in x:
  if i == "R":
    count += 1
    if count >= max:
      max = count
  else:
    count = 0
print(max)

Submission status: Accepted

Solution code:
s=input()
print(('R' in s)+('RR' in s)+('RRR' in s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
if a.count('RRR') > 0:
    print(3)
elif a.count('RR') > 0:
    print(2)
elif a.count('R') > 0:
    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:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

    cnt = s.count('R')
    if cnt != 2:
        print(cnt)
        return

    if s[0] == s[-1] == 'R':
        print(1)
    else:
        print(2)


if __name__ == '__main__':
    main()

# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
from collections import Counter, deque, defaultdict
from math import floor, ceil
from bisect import bisect_left
from itertools import combinations
setrecursionlimit(100000)

INF = int(1e10)
MOD = int(1e9 + 7)

def main():
    from builtins import int, map
    S = input()
    if 'R' not in S:
        print(0)
    else:
        if S in set({'RRR'}):
            print(3)
        elif S in set({'RRS', 'SRR'}):
            print(2)
        else:
            print(1)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()

ans=0
cnt=0

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import math


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read

#n,*a = map(int,read().split())

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
weathers = input()

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

Submission status: Accepted

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

print(n)

Submission status: Accepted

Solution code:
import math
from collections import defaultdict,deque
from itertools import permutations
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:list(input())
ips=lambda:input().split()

"""========main code==============="""

t=1
#t=ii()
for _ in range(t):
    s=ip()
    ans=s.count('R')
    if(ans==2 and s[0]=='R' and s[2]=='R'):
        ans=1
    print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	A
# CreatedDate:  2020-08-15 20:38:43 +0900
# LastModified: 2020-08-15 21:01:55 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()
if S == "RRR":
    print(3)
elif S[0:2] == "RR" or S[1:3] == "RR":
    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()
result = 0
tmp = 0
for c in s:
    if c == 'R':
        tmp += 1
    else:
        tmp = 0
    result = max(result, tmp)

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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 = list(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" not in s:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
#A

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

Submission status: Accepted

Solution code:
s=input()
c=0
for i in range(3):
  if s[i]=='R':
    c+=1
if s=='RSR' :
  print(1)
else:
  print(c)

Submission status: Accepted

Solution code:
S = input()

ans = S.count("R")

if ans != 2:
  print(ans)
elif S[1] != "R":
  print(1)
else:
  print(2)

Submission status: Accepted

Solution code:
S = input()
cnt = 0
ans = 0
for s in S:
    if s == "R":
        cnt += 1
        ans = max(ans, cnt)
    else:
        cnt = 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 'RRR' in S:
  print(3)
  exit()
elif 'RR' in S:
  print(2)
  exit()
elif 'R' in S:
  print(1)
  exit()
else:
  print(0)

Submission status: Accepted

Solution code:
s=input("")
t=0
maxt=0
for i in s:
    if(i=="R"):
        t+=1
        if(t>maxt):
            maxt=t
    else:
        t=0
print(maxt)