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 == 'SSS':
  print(0)
elif S == 'SSR':
  print(1)
elif S == 'SRR':
  print(2)
elif S == 'SRS':
  print(1)
elif S == 'RSS':
  print(1)
elif S == 'RRS':
  print(2)
elif S == 'RRR':
  print(3)
elif S == 'RSR':
  print(1)

Submission status: Accepted

Solution code:
S = input()

count = 0
for i in range(3):
  if S[i] == 'R':
    count += 1
  elif i == 1 and S[0] == 'R':
    break
  elif i == 2 and S[1] == 'R':
    break
    
print(count)

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()
s = list(S)
a = 0
for i in s:
    if i == 'R':
        a += 1

if a != 2:
    print(a)
elif s[1] == 'R':
    print(2)
else:
    print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy
INF = 10**18


if __name__ == "__main__":
    s = input()
    if "R" in s:
        cnt = 1
    else:
        cnt = 0
    for i in range(len(s)-1):
        if s[i] == "R" and s[i+1] == "R":
            cnt+=1
    print(cnt)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()

L_3=["RRR"]
L_2=["RRS", "SRR"]
L_0=["SSS"]

if s in L_3:
    print(3)
elif s in L_2:
    print(2)
elif s in L_0:
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
import math
import sys
#####sorting a dictionary by the values#####
def dict_sort(ans):
    ans=sorted(ans.items(),reverse=True,key=lambda kv:(kv[1]))
##### naive method for testing prime or not#####
def is_prime(n):
    if n==1:
        return 0
    for i in range(2,int(math.sqrt(n))+1):
        if n%i==0:
            return False
    return True
#####greatest common divisor of two numbers#####
def gcd(a,b):
    if b==0:
        return a
    return gcd(b,a%b)
#####least common multiplyer of two numbers#####
def lcm(a,b):
    return (a*b)//gcd(a,b)
#####function that return all the letters#####
def alphbates():
    return "abcdefghijklmnopqrstuvwxyz"
#####binary search#####
def binary_search(ls,n,flag):
    low=0
    hi=n-1
    while(low<=hi):
        mid=(low+hi)//2
        if ls[mid]==flag:
            return mid
        elif ls[mid]>flag:
            hi=mid-1
        else:
            low=mid+1
    return -1
#####taking an array/list as input#####
def inp():
    ls=list(map(int,input().split()))
    return ls
#####taking multiple inputs#####
def mult_inp():
    return map(int,input().split())
#####Main function starts from here#####
s=input()
ls=[]
k=0
for i in range(len(s)):
    if s[i]=='S':
        ls.append(k)
        k=0
    else:
        k+=1
ls.append(k)
print(max(ls))

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

Submission status: Accepted

Solution code:
s = str(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:
import sys
input = sys.stdin.readline

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)

main()

Submission status: Accepted

Solution code:
S = input()

if S == 'SSS':
    print(0)
elif S == 'RRR':
    print(3)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
INF = 1 << 60
MOD = 10**9 + 7 # 998244353
sys.setrecursionlimit(2147483647)
input = lambda:sys.stdin.readline().rstrip()
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:
# N, D = [int(i) for i in input().split()]
# K = int(input())
S = input()
if S == 'RRR':
  print(3)
elif S == 'RRS' or S == 'SRR':
  print(2)
elif 'R' in S:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
import sys
def S(): return sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
a = list(str(input()))
cnt=0

if a[0]=="R":
    cnt+=1
    if a[1]=="R":
        cnt+=1
        if a[2]=="R":
            cnt+=1
elif a[1]=="R":
    cnt+=1
    if a[2]=="R":
        cnt+=1
elif a[2]=="R":
    cnt+=1


print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# abc175 a
#
import sys
from io import StringIO
import unittest


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

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

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

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


def resolve():
    S = input()
    C = S.count("R")
    if C == 2 and "RR" not in S:
        print("1")
    else:
        print(C)


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

Submission status: Accepted

Solution code:
s = input()

if s == 'RRR':
    print(3)
elif s == 'RRS' or s == 'SRR':
    print(2)
elif 'R' in s:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
s=input()
maxsofar = 0

c=0
for i in s:
    if i=="R":
       c+=1
    else:
        c=0

    maxsofar=max(c,maxsofar)

print(maxsofar)

Submission status: Accepted

Solution code:
S = input()
r = 0

if S == "RRR":
  r = 3
elif S == "RRS" or S == "SRR":
  r = 2
elif S == "RSR" or S.count('R') == 1:
  r = 1
else:
  r = 0

print(r)

Submission status: Accepted

Solution code:
list = input()
#print(list[2])
#print(len(list))
cnt = 0
if list[0] == list[1] == list[2] and list[1] == "R":
  print(3)
elif list[0] == list[1] and list[1] == "R":
  print(2)
elif list[1] == list[2] and list[2] == "R":
  print(2)
elif list[1] == "R" or list[0] == "R" or list[2] == "R":
  print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


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

Submission status: Accepted

Solution code:
import re
s = input()
array = re.split(r'S+', s)
print(max([len(e) for e in array]))

Submission status: Accepted

Solution code:
def solve():
  S = input()
  if S[0]=='R' and S[1]=='R' and S[2]=='R':
    return 3
  if S.count('R')==2:
    if S[1]!='R':
      return 1
    return 2
  if S.count('R')==1:
    return 1
  return 0
print(solve())

Submission status: Accepted

Solution code:
s = input()
n = 0 
ans = 0
 
for ch in s:
  if ch == 'R':
    n += 1
  else:
    if ans < n:
      ans = n
    n = 0

if ans < n:
  ans = n

print(ans)

Submission status: Accepted

Solution code:
#A - Rainy Season
Si = []
Si = list(str(input()))
i = 0
if Si == ['S','S','S']: i = 0
if Si == ['R','S','S']: i = 1
if Si == ['S','R','S']: i = 1
if Si == ['S','S','R']: i = 1
if Si == ['R','R','S']: i = 2
if Si == ['S','R','R']: i = 2
if Si == ['R','S','R']: i = 1
if Si == ['R','R','R']: i = 3
# 出力
print(i)

Submission status: Accepted

Solution code:
s=input()
x=s.count("R")
if x==0 or x==1 or x==3:
    print(x)
else:
    if s.rindex("R")-s.index("R")==1:
        print(2)
    else:
        print(1)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A = input()

cnt = A.count('R')
if cnt == 2:
  ccc = A.find('S')
  if ccc == 1:
    cnt =1

print(cnt)

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
ans = 0
cnt = 0
for i in range(len(s)):
    if s[i] == 'R':
        cnt += 1
    else:
        cnt = 0
    ans = max(ans, cnt)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
n="".join(n)
c,ans=0,0
for i in range(3):
    if n[i]=="R":
        c+=1
        ans=c
    else:
        c=0
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
if a == "RRR":
  print(3)
elif "RR" in a:
  print(2)
elif a == "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()
counter = 1
buffer = 0
if 'R' not in s:
    print(0)
else:
    for i in range(len(s)):
        if s[i] == 'R':
            buffer += 1
        else:
            if buffer > counter:
                counter = buffer
            buffer = 0
        if buffer > counter:
            counter = buffer
    print(counter)

Submission status: Accepted

Solution code:
x = input()

if x == "RRS" or x == "SRR":
    print(2)

elif x == "RRR":
    print(3)

elif x == "RSS" or x == "SRS" or x == "SSR" or x == "RSR":
    print(1)

else:
    print(0)

Submission status: Accepted

Solution code:
r = 0
s = input().strip()
for c in s:
    if c == "R":
        r += 1
if "RSR" == s:
    print(1)
else:
    print(r)

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()
list1 = a.split("S")

if len(list1) == 1:
  print(3)
elif len(list1) == 2:
  if a == "RSR":
    print(1)
  else:
    print(2)
elif len(list1) == 3:
  print(1)
else:
  print(0)

Submission status: Accepted

Solution code:
S = list(input())

#check

#真ん中がR
if S[1] == 'R':
    if S[0] == S[2]:
        if S[0] == 'R':
            print(3)
        else:
            print(1)
    else:
        print(2)

#真ん中がS
if S[1] == 'S':
    if S[0] == S[2]:
        if S[0] == 'R':
            print(1)
        else:
            print(0)
    else:
        print(1)

Submission status: Accepted

Solution code:
S = input()

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

print(mr)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
import sys
s=str(input())
if s[0]=="R" and s[1]=="R" and s[2]=="R":
  print(3)
  sys.exit()
if s[0]=="R" and s[1]=="R":
  print(2)
  sys.exit()
if s[1]=="R" and s[2]=="R":
  print(2)
  sys.exit()
if s[0]=="R" or s[1]=="R" or s[2]=="R":
  print(1)
  sys.exit()
else:
  print(0)

Submission status: Accepted

Solution code:
frase= input()
cont=0
if frase[0]=='R' and frase[1]=='S' and frase[2]=='R':
    cont=1
else:
    for x in range(len (frase)):
        if frase[x]=='R':
            cont+=1

print(cont)

Submission status: Accepted

Solution code:
s = input()
a = s.count("RRR")
b = s.count("RR")
if a == 1:
    print(3)
elif b == 1:
    print(2)
else:
    if s.count("R") > 0:
        print(1)
    else:
        print(0)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

f = 0
cnt = 0
for i in n:
    
    if i == 'R' and f == 1:
            cnt += 1
    elif i == 'R':
        f = 1
        cnt = 1
    elif i == 'S':
        f = 0
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

count = 0
max_count = 0

for i in s:
    if i == "R":
        count += 1
    else: 
        if max_count <= count:
            max_count = max(max_count,count) 
        count =0
if max_count <= count:
    max_count = count
print(max_count)

Submission status: Accepted

Solution code:
s = input()

if s.count('R') == 3 :
  print(3)
elif s.count('R') == 1:
  print(1)
elif s.count('R') == 0:
  print(0)
elif s.count('R') == 2:
  res = [i for i in range(len(s)) if s.startswith('R', i)]
  if sum(res) == 2:
    print(1)
  else:
    print(2)

Submission status: Accepted

Solution code:
i = 0
j = 0
k = 0

w = ""
for s in input():
    j += 1

    if s == "S":
        k += 1

    if s == "S" and i > 0 and j == 2 and w != "R":
        i -= 1

    if s == "R" and (w == "R" or w == ""):
        i += 1
    elif s == "R" and w != s:
        i += 1    
    
    if w == "S":
        i = 1
    
    w = s

if k == 3:
    i = 0

print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A = input()
count = 0
for i in range(3):
  if A[i] == "R":
    count = 1
for i in range(2):
  if A[i]+A[i+1] == "RR":
    count = 2
if A == "RRR":
  count = 3
    
print(count)

Submission status: Accepted

Solution code:
S = input()
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:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

s = readline().rstrip().decode('utf-8')

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

count = 0

# print(S)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
n = S.count('R')
if n in [0,1,3]:
    print(n)
else:
    if S[1] == 'R':
        print(2)
    else:
        print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
char = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
s = input()
S = list(s)
re = 0
a = 0
for i in range(3):
    if S[i] == 'R':
        a += 1
if a > 0:
    if a == 2:
        if S[0] == S[1] or S[1] == S[2]:
            re = 2
        else:
            re = 1
    elif S[0] == S[1] and S[1] == S[2] and a == 3:
        re = 3
    else:
        re = 1
else:
    re = 0
print(re)

Submission status: Accepted

Solution code:
weather = input()

if weather in ["RRR"]:
    print("3")
elif weather in ["SRR","RRS"]:
    print("2")
elif weather in ["SSR","SRS","RSS","RSR"]:
    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(f'{ans}')


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = input()
rainyDay = weather.count('R')
if rainyDay < 2:
    print(rainyDay)
else:
    if weather[1] == 'R':
        print(rainyDay)
    else:
        print(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in s:
  if be==i and be=="R":
    count+=1
    
  be=i
  
if s.count("R")>=1 and count==0:
  print(1)
  
else:
  print(count+1 if count>=1 else count)

Submission status: Accepted

Solution code:
S= input()
count = 0
if not 'R' in S:
    print(0)
elif S[1] != 'R':
    print(1)
else:
    for i in S:
        if i == 'R':
            count += 1
    print(count)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
import sys


def read_input():
    return sys.stdin.readline().strip().split(' ')


def task(s):
    rainy_til = []
    l = len(s)
    i = 0
    while i < l:
        if s[i] == 'R':
            last_rainy = rainy_til[i - 1] if i > 0 else 0
            rainy_til.append(last_rainy + 1)
        else:
            rainy_til.append(0)
        i += 1
    return max(rainy_til)


def main():
    [s] = read_input()
    result = task(s)
    print(result)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = input()
i = 0
if 'R' in str:
        i += 1
        if(str.count('R')>= 2):
                for j in range(len(str)-1):
                        if str[j] == str[j+1]:
                                i += 1
print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
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()
list_s = list(S)
count = 0
x = []
for i in range(3):
    if list_s[i] == 'R':
        count +=1
    elif list_s[i] == 'S':
        x.append(count)
        count = 0
x.append(count)
print(max(x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def b(line):
	cnt = 0
	for i in range(len(line)):
		if cnt < 1 and line[i] == 'R':
			cnt += 1
			continue
		if cnt >= 1 and line[i] == line[i-1] and line[i] == 'R':
			cnt += 1
			continue
	return cnt

print(b(input()))

Submission status: Accepted

Solution code:
import sys
from collections import deque
import bisect
import copy
import heapq
import itertools
import math
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    S = input().strip().split("S")
    print(max(len(s) for s in S))


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

Submission status: Accepted

Solution code:
import re
RS = input()

if re.search(r'(R)\1{2,}', RS):
  print(3)
elif re.search(r'(R)\1{1,}', RS):
  print(2)
elif RS == "SSS":
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
X = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:

import collections
from functools import lru_cache


def read():
    return input().strip()


def readInt():
    return int(input().strip())


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


def solve(s):
    i = 0
    N = len(s)
    ans = 0

    while i < N:
        while i < N and s[i] == "S":
            i += 1

        if i >= N:
            break

        j = i+1

        while j < N and s[j] == "R":
            j += 1

        ans = max(ans, j-i)
        i = j

    return ans


s = read()
print(solve(s))

Submission status: Accepted

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

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:
N=str(input())
ia =0
z =0

for i in range(len(N)):
    if N[i]=="R":
        ia+=1
        if ia>z:
            z=ia
    else :
        if ia>z:
            z=ia
        ia=0

print(z)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

cnt = 0

for i in range(3):
    if n[i] == 'R':
        cnt += 1
if cnt == 2 and n[1] == 'S':
    print(1)
    exit(0)
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())
l = len(s)
rain =int()
maxrain =int()
for x in range(l):
  if s[x]=="R":
    rain=rain+1
    maxrain=rain
  else:
    rain=0
    maxrain=maxrain
print(maxrain)

Submission status: Accepted

Solution code:
s = input()
stack = []
ans = 0
for i in range(3):
    if s[i] == "R":
        stack.append("R")
        ans = max(ans, len(stack))
    else:
        stack = []

print(ans)

Submission status: Accepted

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