Problem:


Score : 100 points

Problem Statement

We have weather records at AtCoder Town for some consecutive three days. A string of length 3, S, represents the records - if the i-th character is S, it means it was sunny on the i-th day; if that character is R, it means it was rainy on that day.

Find the maximum number of consecutive rainy days in this period.

Constraints

|S| = 3

Each character of S is S or R.

Input

Input is given from Standard Input in the following format:

S

Output

Print the maximum number of consecutive rainy days in the period.

Sample Input 1

RRS

Sample Output 1

2

We had rain on the 1-st and 2-nd days in the period. Here, the maximum number of consecutive rainy days is 2, so we should print 2.

Sample Input 2

SSS

Sample Output 2

0

It was sunny throughout the period. We had no rainy days, so we should print 0.

Sample Input 3

RSR

Sample Output 3

1

We had rain on the 1-st and 3-rd days - two "streaks" of one rainy day, so we should print 1.



Sample input:
RRS


Sample output:
2

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# import sys
# import math #sqrt,gcd,pi
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# from itertools import product,permutations,\
    # combinations,combinations_with_replacement
# 重複あり順列、順列、組み合わせ、重複あり組み合わせ
# import collections # deque
# from operator import itemgetter,mul
# from fractions import Fraction
# from functools import reduce

mod = int(1e9+7)
# mod = 998244353
INF = 1<<50

def readInt():
    return list(map(int,input().split()))

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

if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = str(input())

r = s.count('R')

if r == 2 and s[1] == 'R':
    v = 2
elif r == 2 and s[1] == 'S':
    v = 1
else:
    v = r
print(v)

Submission status: Accepted

Solution code:
x = input()

if x[0]=='R' and x[1]=='R' and x[2]=='R':
    ans=3
if x[0]=='R' and x[1]=='R' and x[2]=='S':
    ans=2
if x[0]=='R' and x[1]=='S' and x[2]=='R':
    ans=1
if x[0]=='R' and x[1]=='S' and x[2]=='S':
    ans=1
if x[0]=='S' and x[1]=='R' and x[2]=='R':
    ans=2
if x[0]=='S' and x[1]=='R' and x[2]=='S':
    ans=1
if x[0]=='S' and x[1]=='S' and x[2]=='R':
    ans=1
if x[0]=='S' and x[1]=='S' and x[2]=='S':
    ans=0

print(ans)

Submission status: Accepted

Solution code:
n=str(input())
cnt=0
for i in range(len(n)):
  if n[i]=="R":
    cnt+=1
if n[1]=="S" and cnt==2:
  print(1)
else:
  print(cnt)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

s=SI()
if s[0]==s[1]==s[2]=="S":
    print(0)
    sys.exit()
count=0
if s[0]==s[1]=="R":
    count+=1
if s[1]==s[2]=="R":
    count+=1
print(count+1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
# coding: utf-8

def main():
    s = input()
    ans = 0
    tmp = 0
    for i in s:
        if i == "R":
            tmp += 1
        else:
            if tmp >= ans:
                ans = tmp
            tmp = 0
    print(max(ans, tmp))

main()

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
n=str(input())
rain_max=0
rain=0
for i in n:
  if i=='R':
    rain+=1
    if rain>rain_max:
      rain_max=rain
  else:
    rain=0
print(rain_max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

r = input()

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

Submission status: Accepted

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

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

def main():
    S = input()
    ans = 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:
a=list(input())
t=0
p=0
for i in range(len(a)):
  if a[i]=='R':
    t+=1
  else:
    p=max(p,t)
    t=0
print(max(p,t))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

ans = 0
tmp = 0
f = True
for i in s:
    if i == "R":
        if f == True:
            tmp += 1
        else:
            tmp = 1
            f = True
    else:
        f = False
    ans = max(tmp,ans)

print(ans)

Submission status: Accepted

Solution code:
st = input()
tmp=0
rt = 0
for i in range(len(st)):
  if st[i] == "R":
    tmp+=1
    if tmp > rt:
      rt = tmp
  else:
    tmp = 0
print(rt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = sorted(input().split("S"), reverse=True)
print(len(s[0]))

Submission status: Accepted

Solution code:
def main():
    from sys import setrecursionlimit, stdin, stderr
    from os import environ
    from collections import defaultdict, deque, Counter
    from math import ceil, floor
    from itertools import accumulate, combinations, combinations_with_replacement
    setrecursionlimit(10**6)
    dbg = (lambda *something: stderr.write("\033[92m{}\033[0m".format(str(something)+'\n'))) if 'TERM_PROGRAM' in environ else lambda *x: 0
    input = lambda: stdin.readline().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    P = 10**9+7
    INF = 10**18+10

    S = input()
    cont = 0
    ans = 0
    for c in S:
        if c == 'R':
            cont += 1
        else:
            ans = max(ans,cont)
            cont = 0
    print(max(ans,cont))

    
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()


def solve():
    if s.__contains__('RRR'):
        return 3
    elif s.__contains__('RR'):
        return 2
    elif s.__contains__('R'):
        return 1

    return 0


print(solve())

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l=input()
n=len(l)
i=0
ans=0
while i<n:
	j=0
	if l[i]=='R':
		c=0
		while i+j<n and l[i+j]==l[i]:
			c+=1	
			j+=1 
		ans=max(ans,c)
		i+=j
	else:
		i+=1
print(ans)

Submission status: Accepted

Solution code:
###############################################
#                                             #
#   author: raghav_0901 (Raghav Dalmia)       #
#   updated on: 15-08-2020,  5:33:12 pm IST   #
#                                             #
###############################################


from math import *


def _in():
    arr = [int(x) for x in input().split(' ')]
    return arr[0] if len(arr) == 1 else arr


if __name__ == "__main__":
    s = input()
    if(s == "RRR"):
        print(3)
    else:
        if(s[:2] == "RR"):
            print(2)
        elif(s[1:] == "RR"):
            print(2)
        else:
            if(s.count("R") > 0):
                print(1)
            else:
                print(0)

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
#======================================================#
def main():
    s = IS()
    if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
        print(3)
    elif s[0] == 'R' and s[1] == 'R':
        print(2)
    elif s[1] == 'R' and s[2] == 'R':
        print(2)
    elif s[0] == 'R' or s[1] == 'R' or s[2] == 'R':
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S=input()
if S.find("RRR")!=-1:
    print("3")
    exit()
if S.find("RR")!=-1:
    print("2")
    exit()
if S.find("R")!=-1:
    print("1")
    exit()
else:
    print("0")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
c = 0
try:
    for i in range(s.index("R"), len(s)):
        if s[i] == "S":
            break
        c += 1
    print(c)
except ValueError:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    s = gete()

    if s in ['RRS', 'SRR']:
        print(2)
    elif s in ['SSS']:
        print(0)
    elif s in ['RRR']:
        print(3)
    else:
        print(1)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

S=input()
ans=1
if S=="SSS": ans=0
if S=="RRR": ans=3
if S=="RRS" or S=="SRR": ans=2

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    S = input()

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






if __name__ == "__main__":
    main()

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:
#n=int(input())
s=input()
if not("R" in list(s)):
  count=0
  print(count)
else:
  count=1
  for i in range(2):
    if s[i]=="R" and s[i+1]==s[i]:
      count+=1
  print(count)

Submission status: Accepted

Solution code:
# = int(input())
S = str(input())
# = map(int, input().split())
# = list(map(int, input().split()))
# = [int(input()) for i in range(N)]
# = [list(map(int, input().split())) for i in range(N)]


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

Submission status: Accepted

Solution code:
s = input()

if "R" not in s:
    print(0)
    exit()
ans = 1
for i in range(2):
    if s[i] == "R" and s[i+1] == "R":
        ans += 1

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=list(input())
counter=0
counter_max=0
for i in range(len(s)):
    if s[i]=='R':
        counter+=1
    else:
        if counter>counter_max:
            counter_max=counter
        counter=0
if counter>counter_max:
            counter_max=counter
print(counter_max)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()
val = str.count("R")
if str[1] != "R" and val != 0: print(1)
else: print(val)

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

s = ns()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
c = 0
max = 0
for i in range(len(s)):
	if s[i] == 'R':
		c += 1
	if max < c:
		max = c
	if s[i] == 'S':
		c = 0
print(max)

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().split('S')
# print(s)
ans = 0
for x in s:
    ans = max(ans, len(x))
print(ans)

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math
import fractions
import collections
import itertools
S=list(input())
cnt=0
ans=0
if S[0]=="R":
    cnt=1
for i in range(1,len(S)):
    if S[i]=="R":
        cnt=cnt+1
    else:
        ans=max(ans,cnt)
        cnt=0
ans=max(ans,cnt)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=[0]
for i in input():
    if i=="R":a+=[a[-1]+1]
    else:a+=[0]
print(max(a))

Submission status: Accepted

Solution code:
S = input()
from collections import defaultdict
C = defaultdict(int)
for s in S:
    C[s] += 1
if C["R"] == 3:
    print(3)
elif C["S"] == 3:
    print(0)
elif C["R"] == 1:
    print(1)
else:
    if S == "RSR":
        print(1)
    else:
        print(2)

Submission status: Accepted

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

for i in range(3):
  if s[i] == "S":
    cnt = 0
  else:
    cnt += 1
    if max_cnt < cnt:
      max_cnt = cnt
    
print(max_cnt)

Submission status: Accepted

Solution code:
s=input()
ans=0
i=0
while i<3 and s[i]=='S':
    i+=1
while i<3 and s[i]=='R':
    i+=1
    ans+=1

print(ans)

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()
count = 0
for i in s:
    if i == 'R':
        count += 1
if count == 2:
    if s[1] == 'S':
        count -= 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (
    acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians,
    sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits


def inp():
    return(int(input()))


def inlist():
    return(list(map(int, input().split())))


def instr():
    s = input()
    return(list(s[:len(s)]))


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


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

print(m)

Submission status: Accepted

Solution code:
str = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 175

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

Submission status: Accepted

Solution code:
import math
import itertools
import sys
s = input()
cnt = 0
for i in range(3):
    if(s[i] == 'R'):
        cnt += 1
if(cnt == 1 or cnt == 3):
    print(cnt)
elif(cnt == 0):
    print(0)
else:
    if(s[1] == 'R'):
        print(2)
    else:
        print(1)

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
s = input()
i = 0
flag = False
ans = 0
for i in range(len(s)):
    if flag:
        if s[i] == 'R':
            ans += 1
        else:
            flag = False
    else:
        if s[i] == 'R':
            ans = max(ans,1)
            flag = True
        else:
            flag = False
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[9]:


S = input()


# In[10]:


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


# In[ ]:

Submission status: Accepted

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


def solve(S: str):
    if S=="RRR":
        ans=3
    elif "RR" in S:
        ans=2
    elif "R" in S:
        ans=1
    else:
        ans=0
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
count=0
for d in s:
    if d=="R":
        count += 1
if count == 2:
    if s[1]=="S":
        print(1)
    else:
        print(2)
else:
    print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
weather = input()
suc_rain = 0
suc_rain_max = 0
for s in weather:
    if s == 'R':
        suc_rain += 1
    else:
        suc_rain = 0
    suc_rain_max = max(suc_rain_max, suc_rain)
print(suc_rain_max)

Submission status: Accepted

Solution code:
s=input()
ans = 0
if "R" in s:
  ans = 1
if s[0] == s[1] == "R":
  ans += 1
if s[1] == s[2] == "R":
  ans += 1
print(ans)

Submission status: Accepted

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

s=input().strip()
ans = []
count=0
for i in range(3):
    if s[i]=='R':
        count+=1
    else:
        ans.append(count)
        count = 0
ans.append(count)
print(max(ans))

Submission status: Accepted

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

import sys
input=sys.stdin.readline

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
count = s.count("R")

if count == 0:
    print("0")
elif count == 1:
    print("1")
elif count == 2:
    if s == "RSR":
        print("1")
    else:
        print("2")
else:
    print("3")

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 "RRR" in s: ans = 3
elif "RR" in s: ans = 2
elif "R" in s: ans = 1
print(ans)

Submission status: Accepted

Solution code:

from itertools import groupby
def resolve():
    S = input()
    gr = groupby(S)
    ans = 0
    for k, v in gr:
        if k == "R":
           ans = len(list(v))
    print(ans)
    
if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
s = input()
n = s.count("R")
if(s == "RSR"):
  n = 1
print(n)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.readline

def main():
    S = input()[:-1]
    if S == 'RRR':
        print(3)
    elif S in ['RRS', 'SRR']:
        print(2)
    elif S == 'SSS':
        print(0)
    else:
        print(1)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = list(input())

ans = 0
for i in S:
  if i == "R":
    ans += 1

if ans != 0 and S[1] != "R":
  ans = 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
S = input()

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

Submission status: Accepted

Solution code:
S = input()

x0 = 0
x = 0

for c in S:
    if c == 'R':
        x0 += 1
        x = max(x, x0)
    else:
        x0 = 0

print(x)