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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

count = 0 if s=='SSS' else 1
for i in range(1,len(s)):
    if s[i] == 'R' and s[i-1] == s[i]:
        count += 1

print(count)

Submission status: Accepted

Solution code:
arr = list(input())
z = 1
result = 1
count = 0
for i in range(len(arr) - 1):
    if arr[i] == arr[i+1] == "R":
        z += 1
        result = max(result, z)
    else:
        z = 1
if set(arr) == {'S'}:
    print(0)
else:
    print(result)

Submission status: Accepted

Solution code:
num = list(map(str,input()))
if num[0]== 'R' and num[1] =='S':
    print('1')
else:
    print(num.count('R'))

Submission status: Accepted

Solution code:
S=input()

answer = 0
count = 0
for i in S:
    if i == "R":
        count += 1
    else:
        if count > answer:
            answer = count
        count = 0
else:
    if count > answer :
        answer = count

print(answer)

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:
# coding: utf-8
import math

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

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
import sys
sys.setrecursionlimit(10**9)


INF=10**20
def solve(S: str):
    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)
 
    return

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 = 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()
d = {
    'SSS': 0,
    'SSR': 1,
    'SRS': 1,
    'SRR': 2,
    'RSS': 1,
    'RSR': 1,
    'RRS': 2,
    'RRR': 3,
}
print(d[s])

Submission status: Accepted

Solution code:
a = input()

if a =='RRR':
  print(3)
elif 'RR' in a: 
  print(2)
elif 'R' in a: 
  print(1)

else: print(0)

Submission status: Accepted

Solution code:
cnt = 0
t = input()
for i in range(len(t)):
    if "R" * (i + 1) in t:

        cnt = i + 1
print(cnt)

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()
counter = 0
max_counter = 0
for si in s:
    if si == 'R':
        counter += 1
    else:
        counter = 0
    
    max_counter = max(counter,max_counter)

print(max_counter)

Submission status: Accepted

Solution code:
S = input()
li = list(S)
count = 0
re_num = 0
for num in range(3):
    if li[num] == "R" :
        count = count + 1

if count == 0 :
    re_num = 0
elif count == 1 :
    re_num = 1
elif count == 2 and li[1] == "S" :
    re_num = 1
elif count == 2 and li[1] == "R" :
    re_num = 2
else :
    re_num = 3

print(re_num)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
for i in range(4)[::-1]:
    if "R"*i in s:
        print(i)
        break

Submission status: Accepted

Solution code:
s=input()
for i in range(4)[::-1]:
    if "R"*i in s:
        print(i)
        break

Submission status: Accepted

Solution code:
from math import gcd

from math import factorial as f

from math import ceil, floor, sqrt
import math

import bisect
import re
import heapq

from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(map(int, input().split()))

yes = "Yes"
no = "No"


def main():
    s = input()
    s = 'S' + s + 'S'
    cnt = 0
    tmp = 0
    for i in s:
        if i == 'S':
            cnt = max(cnt, tmp)
            tmp = 0
        else:
            tmp += 1
    print(cnt)


main()

Submission status: Accepted

Solution code:
import numpy as np
import sys
input = sys.stdin.readline

tenki = input()
tenki = list(tenki)

max = 0

num = tenki.count("R")

if num == 0:
  out = 0
elif num == 1:
  out = 1
elif num == 3:
  out = 3
elif num == 2:
  if tenki[1]=="S":
    out = 1
  else:
    out = 2

print(out)

Submission status: Accepted

Solution code:
X = str(input())
if X[0]=='R' and X[1]=='R' and X[2]=='R':
    print(3)
elif (X[0]=='R' and X[1]=='R') or (X[1]=='R' and X[2]=='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:
'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd 
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
mod=1000000007
# mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')

file = 1




    
def solve():

    
    # for _ in range(ii()):

        s = list(si())
        if 'S' not in s:
            print(3)
        elif('R' not in s):
            print(0)
        elif(s[1]=='R' and (s[0]=='R' or s[2]=='R')):
            print(2)
        else:
            print(1)













        
if __name__ =="__main__":

    if(file):

        if path.exists('input.txt'):
            sys.stdin=open('input.txt', 'r')
            sys.stdout=open('output.txt','w')
        else:
            input=sys.stdin.readline
    solve()

Submission status: Accepted

Solution code:
s=input()
temp=0
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 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":
    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 = input()

r = 0
ans = 0
for i in s:
    if i == 'R':
        r += 1
    else:
        ans = max(ans, r)
        r = 0

ans = max(ans, r)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
s = input()
if s == "SSS":
    print(0)
elif s == "SRR" or s == "RRS":
    print(2)
elif s == "RRR":
    print(3)
else:
    print(1)

Submission status: Accepted

Solution code:
s=input()
cnt=0
_max=0
for i in [s[0],s[1],s[2]]:
    if i == 'R':
        cnt += 1
        if _max < cnt:
            _max = cnt
    else:
        cnt = 0
print(_max)

Submission status: Accepted

Solution code:
def main():
    S = input()
    if "RRR" == 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 == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
elif s == "RSS" or s == "SRS" or s == "SSR" or s == "RSR":
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
ans = 0
mx = 0
for l in x:
  if l=='R':
    ans+=1
  elif ans>0:
    ans-=1
  if ans>mx:
    mx = ans
print(mx)

Submission status: Accepted

Solution code:
s = input() #sys.stdin.readlineは最後が改行

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()
ct=0
mx=0
for i in s:
  if(i=='R'):
    ct+=1
    mx=max(ct,mx)
  else:
    ct=0
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()
res, prev, count = 0, '', 0
for s in S:
  if s == 'R':
    count += 1
  else:
    res = max(res, count)
    count = 0
print(max(res, count))

Submission status: Accepted

Solution code:
A = list(input())

n = A.count('R')
if n != 2:
    print(n)
else:
    m = A.index('S')
    if m == 1:
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
def solve():
    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__":
    solve()

Submission status: Accepted

Solution code:
S = input()
pre_weather = "S"

cnt = 0
ans = 0
for i in range(3):
    if pre_weather == "R" and S[i] == "R":
        cnt += 1
    elif S[i] == "R":
        cnt = 1
    pre_weather = S[i]
    
    ans = max(cnt,ans)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
for i in range(3, -1, -1):
    if "R" * i in S:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ct_max = 0
ct = 0
for s in list(input()):
    if s == 'R':
        ct += 1
    else:
        ct = 0
    if ct > ct_max:
        ct_max = ct

print(ct_max)

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
if s.count("R") == 3:
    print(3)
elif s.count("R") == 2:
    if s[0] == s[1] or s[1] == s[2]:
        print(2)
    else:
        print(1)
elif s.count("R") == 1:
    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/env python3
import sys


def solve(S: str):
    if 'RRR' in S:
        return 3
    elif 'RR' in S:
        return 2
    elif 'R' in S:
        return 1
    else:
        return 0


# 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
    print(solve(S))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    weather_str = input()

    if weather_str == "SSS":
        print(0)
        exit()

    weather = list(weather_str)
    weather.append("END")

    r = range(len(weather)-1)
    c = []
    start = 1
    tmp = start

    for i in r:
        if weather[i] == "R" and weather[i] == weather[i+1]:
            tmp += 1
        else:
            c.append(tmp)
            tmp = start

    print(max(c))

Submission status: Accepted

Solution code:
input_line = input()
#print(input_line)
charlist = list(input_line)
index = 0
for i in range(3):
    if(charlist[i]=="R"):
        index += 1
    
if index==2:
    if charlist[1]=="S":
        print(1)
        
    else:
        print(index)
        
else:
    print(index)

Submission status: Accepted

Solution code:
s = input()
cnt = 0
maxcnt = 0
for c in s:
    if c == 'R':
        cnt += 1
    else:
        cnt = 0
    if maxcnt < cnt:
        maxcnt = cnt
print(maxcnt)

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

i, r, ans = 0, 0, 0

while i < 3:
    if ws[i] == "R":
        r += 1
        ans = max(ans, r)
    else:
        r = 0
    i += 1
print(ans)

Submission status: Accepted

Solution code:
#A
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:
s = str(input())
l = len(s)
c=0
ans=0
for i in range(0,l):
  if s[i]=='R':
    c+=1
    ans=max(c,ans)
  else:
    ans=max(c,ans)
    c=0
print(ans)

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
i = input()


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

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()
cnt = 0
if S.count("R") == 3:
  cnt = 3
elif S.count("R") == 1:
  cnt = 1
elif S.count("R") == 0:
  cnt = 0
else:
  if (S[0] == "R" and S[1] == "R") or (S[1] == "R" and S[2] == "R"):
    cnt = 2
  else:
    cnt = 1
print(cnt)

Submission status: Accepted

Solution code:
S = input()

flag = False
count = 0
max_c = -1
for s in S:
    if s == "R":
        count += 1
        flag = True
    elif flag:
        max_c = max(count, max_c)
        flag = False
        count = 0
print(max(count, max_c))

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
wether = input()
if wether == 'SSS':
    print(0)
elif wether == 'RRR':
    print(3)
elif wether[:2] == 'RR' or wether[1:] == 'RR':
    print(2)
else:
    print(1)

Submission status: Accepted

Solution code:
s = input()
for i in range(3, -1, -1):
    if 'R' * i in s:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

if 'R' not in s:
    ans = 0
elif 'S' not in s:
    ans = 3
elif s in ('RSR', 'RSS', 'SSR', 'SRS'):
    ans = 1
else:
    ans = 2

print(ans)

Submission status: Accepted

Solution code:
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

s = input()

num = s.count("R")

if s == "RSR":
    print(1)

else:
    print(num)

Submission status: Accepted

Solution code:
text = input()
if text == 'SSS':
    print(0)
elif text == 'RSS':
    print(1)
elif text == 'SRS':
    print(1)
elif text == 'SSR':
    print(1)
elif text == 'RRS':
    print(2)
elif text == 'RSR':
    print(1)
elif text == 'SRR':
    print(2)
elif text == 'RRR':
    print(3)
else:
    print('that is invalid. ')

Submission status: Accepted

Solution code:
x = input()
if x == "SSS":
    print(0)

elif x == "SSR":
    print(1)

elif x == "SRS":
    print(1)

elif x == "RSS":
    print(1)

elif x == "RSR":
    print(1)

elif x == "RRS":
    print(2)

elif x == "SRR":
    print(2)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
count = 0
max_count =0
for i in S :
    if(i=='R'):
        count = count + 1
    else :
        if(max_count < count) :
            max_count = count
            count = 0
if(max_count < count) :
    max_count = count

print(max_count)

Submission status: Accepted

Solution code:
S = input()
a = list()
b = 0
u = 0
for i in range (len(S)):
    if S[u] == 'R':
        b = b + 1
    else:
        a.append(b)
        b = 0
    u = u + 1
a.append(b)
a.sort()
a.reverse()
print(a[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = input()
N = len(weather)

count = 0
answer = 0
for i in range(N):
    if weather[i] == 'R':
        count += 1
        answer = max(answer, count)
    else:
        count = 0

print(answer)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    S = input()
    ans = 0
    for r in S.split("S"):
        ans = max(len(r), ans)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc175/tasks/abc175_a

a= []
a= input(" ")
#print(a[0:3])
if(a[0]==a[1] and a[1]==a[2]):
    if(a[0]=="R"):
        print(3)
    else:
        print(0)
elif(a[1]=="S"):
    if(a[0]=="R" or a[2]=="R"):
        print(1)
elif(a[1]=="R"):
    if (a[0]==a[1] or a[1]==a[2]):
        print(2)
    else:
        print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()

count = 0


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
lst = input()
if lst.count("RRR") == 1:
  print(3)
elif lst.count("RR") == 1:
  print(2)
elif lst.count("R") != 0:
  print(1)
else:
  print(0)

Submission status: Accepted

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

print(imput)

Submission status: Accepted

Solution code:
S = list(input())
RD = S.count('R')
if RD != 2:
    print(RD)
else:
    if S[1] == 'R':
        print(RD)
    else:
        print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
data = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
it = lambda: list(map(int, input().strip().split()))

def solve():
    S = input().strip()
    assert len(S) == 3
    if S[0] == S[1] == S[2] == 'R':
        return 3
    elif S[0] == S[1] == 'R' or S[1] == S[2] == 'R':
        return 2
    elif S[0] == 'R' or S[1] == 'R' or S[2] == 'R':
        return 1
    return 0

if __name__ == '__main__':
    ans = solve()
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input() + "S"

max_count = 0
count = 0
for d in s:
    if d == "R":
        count += 1
    else:
        if count > max_count:
            max_count = count
        count = 0

print(max_count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str1 = input()
if str1 == 'RRR':
    print(3)
elif str1 == 'SSS':
    print(0)
else:
    for i in range(len(str1) - 1):
        if str1[i] == str1[i+1] == 'R':
            flag = 0
            break
        else:
            flag = 1
    if flag == 0:
        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:
s=input()
cnt=0
if s=='RRR':
  cnt = 3
elif s== 'RRS':
  cnt = 2
elif s== 'SRR':
  cnt = 2
elif s == 'RSS':
  cnt= 1
elif s == 'RSR':
  cnt=1
elif s == 'SRS':
  cnt=1
elif s=='SSR':
  cnt=1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
s = input()
max_r = 0
last_c = 0
for x in s:
    last_c = last_c + 1 if x == 'R' else 0 
    max_r = max(max_r, last_c)
print(max_r)

Submission status: Accepted

Solution code:
import sys

# A - Rainy Season
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:
curr=0
mx=0
s=input()
for i in s:
    if i=='R':
        curr+=1
    else:
        mx=max(mx,curr)
        curr=0
mx=max(mx,curr)
print(mx)

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 == 'SSS':
    ans = 0
elif s == 'RRR':
    ans = 3
elif s in ['RRS', 'SRR']:
    ans = 2
else:
    ans = 1
print(ans)

Submission status: Accepted

Solution code:
s = list(input())

x = s[0] == "R"
y = s[1] == "R"
z = s[2] == "R"

if x and y and z:
    print(3)
elif (x and y) or (y and z):
    print(2)
elif x or y or z:
    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:
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 = str(input())
cnt = 0
Max = 0
for i in range(len(s)):
    if s[i] == "R":
        cnt += 1
    else:
        Max = max(Max,cnt)
        cnt = 0
Max = max(Max,cnt)
print(Max)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)

# lis_of_lis = [[] for _ in range(N)]


def zz():
    return list(map(int, sys.stdin.readline().split()))


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


def S():
    return sys.stdin.readline()[:-1]


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


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

print(ans)

Submission status: Accepted

Solution code:
S=input()

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

print(ans)

Submission status: Accepted

Solution code:
S = input()
ans = 0

if S == "RSR":
    print(1)

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

Submission status: Accepted

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

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:
weather = input().split('S')

Max = 0

for item in weather:
    if len(item) > Max:
        Max = len(item)

print(Max)

Submission status: Accepted

Solution code:
Word=input()
Word_list=list(Word)
 
number=0
renzoku=0
Enter=0
 
for num in range(3):
  if Word_list[num]=="R":
    number=number+1
  if (number>renzoku):
      renzoku=number
  else:
    number=0

print(renzoku)

Submission status: Accepted

Solution code:
s = input()
print(max([1 if s.count('R') else 0, 2 if s.count('RR') else 0, 3 if s.count('RRR') else 0]))

Submission status: Accepted

Solution code:
a=input()
con=0
count=0
for i in range(3):
    if a[i]=='R' and i==2:
        count+=1
        con=max(con,count)
    elif a[i]=='R':
        count+=1
    else:
        con=max(con,count)
        count=0
print(con)