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

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()
countr,maxcountr = 0,0
for i in range(3):	
	if(S[i] == "R"):
		countr += 1
	else:	
		countr = 0
	if(maxcountr < countr):
			maxcountr = countr
print(maxcountr)

Submission status: Accepted

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

Submission status: Accepted

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

cccount = 0
count = 0
for s in splited:
  if s == 'R':
    count = count + 1
    if count > cccount:
      cccount = count
  else:
      count = 0
    
print(cccount)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=str(input())
li=[0]
for i in range(0,len(s)):
    if s[i]=="R":
        val=0
        for ii in range(i,len(s)):
            if s[ii]=="S":
                li.append(val)
                val=0
                break
            else:val+=1
        li.append(val)
print(max(li))

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:
tenki = str(input())
count = 0
tenki_list = []
for n in tenki:
    if n == 'R':
        count +=1
    else:
        count = 0
    tenki_list.append(count)
print(max(tenki_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
p={'RRR':3,'RRS':2,'SRR':2,'RSR':1,'SSR':1,'RSS':1,'SSS':0,'SRS':1}
print(p[input()])

Submission status: Accepted

Solution code:
weather = input()
answer = 0

if weather == 'SSS':
    answer = 0
elif weather == 'SSR' or weather == 'SRS' or weather == 'RSS' or weather == 'RSR':
    answer = 1
elif weather == 'RRR':
    answer = 3
else:
    answer = 2

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = str(input())
cnt = 0
ans = 0
for i in range(len(a)):
    if a[i] == 'S': 
        ans = max(ans, cnt)
        cnt = 0
    else: cnt += 1
print (max(cnt, ans))

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

Solution code:
s = input()
res = 0
f = 0
for i in s:
    if i == 'R':
        if f:
            res += 1
        else:
            f = 1
            res = 1
    else:
        f = 0
print(res)

Submission status: Accepted

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

def get_input() -> str:
    """
    標準入力を取得する.

    Returns:\n
        str: 標準入力
    """
    S = input()

    return S


def main(S: str) -> None:
    """
    メイン処理.

    Args:\n
        S (str): 天気の記録（|S| = 3, Sの各文字は"S"または"R"）
    """
    # 求解処理
    ans = S.count("R") - (S == "RSR")

    # 結果出力
    print(ans)


if __name__ == "__main__":
    # 標準入力を取得
    S = get_input()

    # メイン処理
    main(S)

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
def abc175_a_1():
    def solve():
        # そもそも3文字しか入力ないんだから長い順にチェックしてしまえば問題ない？
        if s.count('RRR'):
            return 3
        if s.count('RR'):
            return 2
        if s.count('R'):
            return 1
        return 0

    s = input()
    print(solve())

if __name__ == '__main__':
    abc175_a_1()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(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:
input_count =input()

input_count = list(input_count)
count = 0
count2 = 0
for i in range(len(input_count)):
  if input_count[i] == 'R':
    count2 += 1
  else:
    count2 = 0
  if count2 >= count:
    count =count2
print(count)

Submission status: Accepted

Solution code:
s = raw_input()
count = 0
a = 0
for j in range(len(s)):
	if s[j] == 'R':
		count +=1
	else:
		count = 0
	a = max(count, a)
print a

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

w_l = s.split('S')
print(max([m for m in map(len, w_l)]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()

if a[0]=='R' and a[1]=='R' and a[2]=='R':
  res = 3
elif  a[0]=='R' and a[1]=='R':
  res = 2
elif  a[1]=='R' and a[2]=='R':
  res = 2  
elif  a[0]=='R':
  res = 1
elif  a[1]=='R':
  res = 1
elif  a[2]=='R':
  res = 1 
else:
  res = 0

res = int(res)
print(res)

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:

s = input()
r = 0
l = 'R'
for i in s:
    r = 1 if i == 'R' and l == 'S' else r
    r += 1 if i == 'R' and l == 'R' else 0
    l = i

print(r)

Submission status: Accepted

Solution code:
s = list(input())
count = 0
result = 0

for v in s:
    if v == 'S':
        count = 0
        continue
    else:
        count += 1
        result = count

print(result)

Submission status: Accepted

Solution code:
s = input()
ans = 0

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

Submission status: Accepted

Solution code:
s = input()

count = 0
ans = 0

for i in s:
    if i == 'R':
        count += 1
    if i == 'S':
        if count >= ans:
            ans = count
        count = 0
if count >= ans:
  ans = count
print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = 0
ss = S.split('S')
for d in ss:
    if len(d) > ans:
        ans = len(d)
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input().split('S')

ans = 0

for i in s:
  if len(i) > ans:
    ans = len(i)
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

a = 0
ma = 0
for ss in s:
    if ss == 'R':
        a += 1
    else:
        a = 0
    ma = max(ma, a)

print(ma)

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 = 3 if s == 'RRR' else 1
if 'RR' in s and s != 'RRR':
    r = 2
elif not 'R' in s:
    r = 0
print(r)

Submission status: Accepted

Solution code:
S = input()

ans = 0

for i in range(3):
  if S[i] == "R":
    ans += 1
  else:
    pass

if S[1] == "S" and ans == 2:
  ans -= 1

print(ans)

Submission status: Accepted

Solution code:
s = input()
 
def A():
  if s == 'RRR':
    return 3
  if s == 'RRS' or s == 'SRR':
    return 2
  if s == 'SSS':
    return 0
  return 1
 
print(A())

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

R_n = 0
R_max = 0
for i in S:
  if i == 'R':
    R_n += 1
  else:
    if R_n != 0:
      R_max = R_n
    R_n = 0
    
if R_n > R_max:
  R_max = R_n

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
if S == 'RRR':
    print(3)

elif S == 'RRS' or S == 'SRR':
    print(2)

elif 'R' in S:
    print(1)

else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from __future__ import division, print_function
# import threading
# threading.stack_size(2**27)
# import sys
# sys.setrecursionlimit(10**7)
# sys.stdin = open('inpy.txt', 'r')
# sys.stdout = open('outpy.txt', 'w')
from sys import stdin, stdout
import bisect            #c++ upperbound
import math
import heapq
i_m=9223372036854775807
def inin():
    return int(input())
def stin():
    return input()
def spin():
    return map(int,stin().split())
def lin():                           #takes array as input
    return list(map(int,stin().split()))
def matrix(n):
    #matrix input
    return [list(map(int,input().split()))for i in range(n)]

################################################
def calculate_sum(a, N): #sum of a to N
    # Number of multiples 
    m = N / a 
    # sum of first m natural numbers 
    sum = m * (m + 1) / 2
    # sum of multiples 
    ans = a * sum
    return ans
def series(N):
    return (N*(N+1))//2

def count2Dmatrix(i,list):
    return sum(c.count(i) for c in list)

def modinv(n,p):
    return pow(n,p-2,p)

def GCD(x, y): 
    x=abs(x)
    y=abs(y)
    if(min(x,y)==0):
        return max(x,y)
    while(y): 
        x, y = y, x % y 
    return x
def LCM (x, y):
    return (x * y) // GCD(x, y)
    
def Divisors(n) : 
    l = []  
    for i in range(1, int(math.sqrt(n) + 1)) :
        if (n % i == 0) : 
            if (n // i == i) : 
                l.append(i) 
            else : 
                l.append(i)
                l.append(n//i)
    return l
def isprime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True
prime=[]
def SieveOfEratosthenes(n): 
    global prime
    prime = [True for i in range(n+1)] 
    p = 2
    while (p * p <= n): 
        if (prime[p] == True): 
            for i in range(p * p, n+1, p): 
                prime[i] = False
        p += 1
    f=[]
    for p in range(2, n): 
        if prime[p]: 
            f.append(p)
    return f
q=[]       
def dfs(n,d,v,c):
    global q
    v[n]=1
    x=d[n]
    q.append(n)
    j=c
    for i in x:
        if i not in v:
            f=dfs(i,d,v,c+1)
            j=max(j,f)
            # print(f)
    return j
# d = {}
 
"""*******************************************************"""
s = list(stin())

c = 0; temp = 0
for i in s:
    if i=='R':
        c+=1
    else:
        if c>0:
            temp = c
        c = 0
print(max(temp, c))

Submission status: Accepted

Solution code:
s = input()

maxR = 0
count = 0

for x in range(len(s)):
  if s[x] == "S":
    maxR = max(maxR, count)
    count = 0
  else:
    count += 1

print(max(count, maxR))

Submission status: Accepted

Solution code:
print(max(map(len,(''.join(map(lambda x : '1' if x=='S' else '0', input()))).split('1'))))

Submission status: Accepted

Solution code:
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()
if s == "RRR":
  print(3)
elif "RR" in s:
  print(2)
elif s == "SSS":
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
ws = list(input())
c=max=0
bef=''
for w in ws:
    if 'R' == w:
        if 'R' == bef: c+=1
        else: c=1
        if max <= c: max =c
    bef=w
print(max)

Submission status: Accepted

Solution code:
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().split('S')
if s.count('RRR'): print(3)
elif s.count('RR'): print(2)
elif s.count('R'): print(1)
else: print(0)

Submission status: Accepted

Solution code:
def main():

    s = input()
    
    ans = 0

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

    print(ans)
    
    return 0

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

S = input()

print(max(map(len, S.split("S"))))

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:
from math import *
from copy import *
from string import *				# alpha = ascii_lowercase
from random import *
from sys import stdin,stdout
from sys import maxsize
from operator import *				# d = sorted(d.items(), key=itemgetter(1))
from itertools import *
from collections import Counter		# d = dict(Counter(l))
import math
import math
import time
from queue import Queue
# PradeepGhosh_2017076

def seive(n):
	l=[True]
	l=l*(n+1)
	for i in range(2,int(sqrt(n))+1):
		if(l[i]==True):
			val=i*i
			while(val<len(l)):
				l[val]=False
				val+=i
	prime=[]
	for i in range(2,len(l)):
		if(l[i]==True):
			prime.append(i)
	return prime

def dp(l,i,n,val,ans):
	if(i>=n or val<0):
		return 1000000
	elif(val==0):
		return 0
	else:
		if(ans[i]==1000000):
			ans[i]=min(min(1+dp(l,i+1,n,val-l[i],ans),1+dp(l,i,n,val-l[i],ans)),dp(l,i+1,n,val,ans))
		return ans[i]
from queue import Queue
def factors(n):
	l=[]
	for i in range(1,int(sqrt(n))+1):
		if(n%i==0):
			if(n//i==i):
				l.append(i)
			else:
				l.append(i)
				l.append(n//i)
	return l
def check1(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v-=1
def check2(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v+=1

def up(n):
	j=n-1
	while(j>0):
		if(n%j==0):
			break
		j-=1
	return j		
def fac(n):
	c=1
	i=1
	while(i<=n):
		c*=i
		i+=1
	return c
def check_happy(n):
	ss=set()
	print(n)
	while(n!=1):
		val=n
		s=0
		print(val)
		while(val!=0):
			s+=(val%10)**2
			val=val//10
		print(val)
		print("hi")
		if(val in ss):
			return False
		else:
			n=val
			ss.add(n)
	return True
def update(a,b):
	c=1
	val=a
	while(a<b):
		print(c,a)
		c+=c
		a+=a
	print(1)
	while(a>b):
		print()
		a-=val
		c-=1
	return c
import random as rand
def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
# nakdna
from itertools import permutations
def insertion_sort(arr):
	for i in range(len(arr)):
		j=i
		while(j>0):
			if(arr[j]<arr[j-1]):
				temp=arr[j]
				arr[j]=arr[j-1]
				arr[j-1]=temp
			j-=1
	return arr
def quick_sort(arr,low,high):
	i=low
	j=high
	
	while(i<j):
		if(arr[i]>arr[low] and arr[j]<arr[low]):
			temp=arr[i]
			arr[i]=arr[j]
			arr[j]=arr[i]
			i+=1
			j-=1
		elif(arr[i]<=arr[low]):
			i+=1
		elif(arr[j]>=arr[low]):
			j-=1
	print(i,j)
	toto=arr[j]
	arr[j]=arr[low]
	arr[low]=toto
	return j
def dodo(arr,low,high):
	if(low<high):
		val=quick_sort(arr,low,high)
		dodo(arr,low,val-1)
		dodo(arr,val+1,high)
def dp(arr,c,n,k,z,ans):
	if(k==0):
		return ans
	else:
		if(c==0):
			return dp(arr,c+1,n,k-1,z,ans+arr[c+1])
		elif(c==n-1):
			if(z==0):
				return 0
			else:
				return dp(arr,c-1,n,k-1,z-1,ans+arr[c-1])
		else:
			if(z==0):
				return dp(arr,c+1,n,k-1,z,ans+arr[c+1])
			else:
				return max(dp(arr,c+1,n,k-1,z,ans+arr[c+1]),dp(arr,c-1,n,k-1,z-1,ans+arr[c-1]))
def check(arr,val):
	a=-1
	for i in range(len(arr)):
		if(arr[i][len(arr[i])-1]==val):
			a=i
			break
	return a

def reverse(s,i,ans):
	if(i>=len(s)):
		return ans
	else:
		return reverse(s,i+1,s[i]+ans)
def update(arr,i,j,n,m):
    if(i>=0 and i<n and j>=0 and j<m):
        if(arr[i][j]==1):
            arr[i][j]==2
            return [i,j]
    return [-1,-1]
if __name__ == '__main__':
	s=input()
	maxa=0
	val=0
	for i in s:
		if(i=="R"):
			val+=1
		else:
			maxa=max(maxa,val)
			val=0
	print(max(maxa,val))

Submission status: Accepted

Solution code:
s = list(input())

count = 0
high = 0
for each in s:
    if each == 'R':
        count += 1
    else:
        count = 0
    if count > high:
        high = count
print(high)

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

Submission status: Accepted

Solution code:
x=input()
o=0
c=0
for i in range(len(x)):
  if x[i]=='S':
    o=max(o,c)
    c=0
  else:
    c+=1
o=max(c,o)

print(o)

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

  
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = 0
r = 0
for s in S:
    if s == "R":
        r += 1
    else:
        r = 0
    ans = max(ans, r)
print(ans)

Submission status: Accepted

Solution code:
A = input()
count = 0
for a in range(3):
    if A[a] == 'R':
      count+=1
      
if count == 2 and A[1] == 'S':
      count = 1
print(count)

Submission status: Accepted

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

def main():
    s = str(input())

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
#import 
s=input()
#=int(input())
#=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

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

print(max)

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

Submission status: Accepted

Solution code:
n = str(input())
d1 = n[0]
d2 = n[1]
d3 = n[2]

if d1 == 'R':
    if d2 == 'R':
        if d3 == 'R':
            print(3)
        else:
            print(2)    
    else:
        print(1)
elif d2 == 'R':
    if d3 == 'R':
        print(2)
    else:
        print(1)
elif d3 =='R':
    print(1)
else:
    print(0)

Submission status: Accepted

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

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 = list(input())
t = s.count('R')

if t == 2:
    if s[1] == 'R':
        ans = t
    else:
        ans = 1
else:
    ans = t
print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = open(0).read().split()[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()

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

Submission status: Accepted

Solution code:
#!/usr/bin python3
# -*- coding: utf-8 -*-

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:
a=list(input())
p=(a[0]=="R")
q=(a[1]=="R")
r=(a[2]=="R")

if (p and q and r):
  print(3)
elif (p and q) or (q and r):
  print(2)
elif (p or q or r):
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()
def s_count(s):
    m = list(s)
    array = [0. for i in range(len(m))]
    count = 0
    for i in range(len(m)):
        if m[i] == 'R':
            array[i] += 1
            if (i > 0 and m[i] == m[i-1]):
                count += 1
                array[i] += count
            else:
                count = 0
    return max(array)
print(int(s_count(s)))

Submission status: Accepted

Solution code:
max_count = 0
count = 0

for s in input():
    if s == 'R':
      count += 1
    else:
        max_count = count if max_count < count else max_count  
        count = 0

max_count = count if max_count < count else max_count

print(max_count)

Submission status: Accepted

Solution code:
import sys, bisect, math, itertools, string, queue, copy
import numpy as np
import scipy
from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
# input = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

S = input()

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

Submission status: Accepted

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