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:
#A - Rainy Season

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

S = sys.stdin.readline().rstrip()

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

Submission status: Accepted

Solution code:
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
for i in range(3):
    if S[i] == 'R':
        # count, 前の文字列がR or nullならcnt+1、そうでない場合、1
        if i == 0 or S[i - 1] == 'R':
            cnt += 1
        else:
            cnt = 1
print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

print(max(m, cnt))

Submission status: Accepted

Solution code:
S = input()

for s in ['RRR', 'RR', 'R']:
    if s in S:
        print(len(s))
        exit()
print(0)

Submission status: Accepted

Solution code:
import re
s=input()

if s == 'RRR':
  print(3)
elif re.search('RR',s):
  print(2)
elif re.search('R',s):
  print(1)
else:
  print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

c = 0
ans = [0]
for i in S:
    if i == "R":
        c += 1
    else:
        ans.append(c)
        c = 0
ans.append(c)
print(max(ans))

Submission status: Accepted

Solution code:
S=input()
print(max(i for i in range(4)if S.count("R"*i)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
n=0
countmax=0
count=0
while n<3:
  if s[n]=="R":
    count+=1
    if countmax<count:
      countmax=count
  elif s[n]=="S":
    count=0
  n+=1
print(countmax)

Submission status: Accepted

Solution code:
import math


def main():
    s = list(input())
    if s.count("R") == 3:
        print(3)
        return
    if s[0] + s[1] == "RR" or s[2] + s[1] == "RR":
        print(2)
        return
    if s.count("R") >= 1:
        print(1)
        return
    print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    S = input()
    ans = 0
    cnt = 0
    for i in range(len(S)):
        if S[i] == 'R':
            cnt += 1
            ans = max(ans, cnt)
        else:
            cnt = 0
    # if S[0] == 'R' and S[1] == 'R' and S[2] == 'R':
    #     ans = 3
    # elif (S[0] == 'R' and S[1] == 'R') or S[1] == 'R' and S[2] == 'R':
    #     ans = 2
    # elif 'R' in S:
    #     ans = 1
    # else:
    #     ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()     # 入力文字列 S
count = 0       # カウンタ
max_r = 0       # 雨の日が連続する回数

# 文字列 Sを一文字ずつループ
for moji in S:
    if moji == "R":
        count += 1
        if max_r < count:
            max_r = count
    else:
        count = 0
print(max_r)

Submission status: Accepted

Solution code:
def check(inpyt):
    count = 0
    if inpyt.count('S') == len(inpyt):
        return 0
    for ele in range(0, len(inpyt)):
        if ele < len(inpyt)+1:
            if inpyt[ele]=='R':
                try:
                    if inpyt[ele+1]==inpyt[ele]:
                        count +=1
                except IndexError as e:
                    pass
    return count+1
    


inpyt = list(input())
print(check(inpyt))

Submission status: Accepted

Solution code:
def clean(max_r, count):
  if max_r < count:
      max_r = count
  return max_r

mojiretsu = input()
count = 0
max_r = 0
for moji in mojiretsu:
  if moji == 'R':
    count += 1
  else:
    max_r = clean(max_r, count)
    count = 0
    
if count != 0:
  max_r = clean(max_r, count)
  
print(max_r)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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()
maxcnt = 0
cnt = 0
for i in range(len(S)):
  l = S[i]
  if l == 'R':
    cnt += 1
    maxcnt = cnt
  else:
    cnt = 0
print(maxcnt)

Submission status: Accepted

Solution code:
s=input();print(s.count('R')-(s=="RSR"))

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 == "RRS" or S == "SRR":
    print(2)
elif "R" in S:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
S = input()

cnt = 0
max_cnt=0

if S[0] == 'R':
    cnt += 1

for i in range(1,3):
    if S[i] == 'R':
        cnt+=1
        # print('i')
    else:
        if cnt > max_cnt:
            max_cnt = cnt
        cnt = 0
if cnt > max_cnt:
    max_cnt = cnt        
if S[len(S)-1] == 'R' and max_cnt == 0:
    max_cnt = 1

print(max_cnt)

Submission status: Accepted

Solution code:
s=input().upper()
c=0
largest=0


for i in range(len(s)-1):
    if s[i] == "R":
        if c == 0:
            c+=1
        if s[i] == s[i+1]:
            c+=1
        #print("dasd",c,i,len(s))
    else:
        #print("asd", c)
        if c > largest:
            largest=c
        c=0
    if i + 2 == len(s):
        if s[i+1] == "R" and c == 0:
            c+=1
        #print("asdfasd")
        if c > largest:
            largest=c

print(largest)

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
def inps():
    return str(input())
def longest(s):
    max_now = 0
    max_glo = 0
    for i in range(len(s)):
        if s[i] == "R": max_now+=1
        else: max_now = 0
        if max_glo<max_now: max_glo=max_now
    return max_glo    

s = inps().rstrip()
print(longest(s))

Submission status: Accepted

Solution code:
import re
r = 0
s = input()
if 'R' not in s:
  print(0)
else:
  x = re.findall('R+',s)
  if len(x) == 2:
      print(1)
  else:
      print(len(x[0]))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

s = sorted(ins().split("S"), reverse=True)
print(len(s[0]))

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
for i in range(4):
    if 'R' * i in S:
        ans = i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
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()
cnt = 0
max_cnt = -1
for s in S:
    if s == 'R':
        cnt += 1
    else:
        if max_cnt < cnt:
            max_cnt = cnt
        cnt = 0
if max_cnt < cnt:
    max_cnt = cnt
print(max_cnt)

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 S == "RRS" or S == "SRR":
    print(2)
else:
    if S.count("R") >= 1:
        print(1)
    else:
        print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    S = rl().rstrip()
    if 'RRR' == 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:
def main():
    S = input()
    for rep in range(3, -1, -1):
        tar = 'R' * rep
        if ~S.find(tar):
            print(rep)
            return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import os
import sys
import math
import heapq
from decimal import *
from io import BytesIO, IOBase
from collections import defaultdict, deque

def r():
    return int(input())
def rm():
    return map(int,input().split())
def rl():
    return list(map(int,input().split()))

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

Submission status: Accepted

Solution code:
s=input()
if s=='RRR':
    print(3)
elif s=='SSS':
    print(0)
elif s in ['RRS','SRR']:
    print(2)
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()
c=0
m=0
for i in s:
    if(i=='R'):
        c=c+1
        m=max(c,m)
    else:
        c=0
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect, collections, copy, heapq, itertools, math, string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
W = input()
cnt = 0
max_cnt = 0
for i in range(3):
    if W[i] == 'S':
        cnt = 0
    else:
        cnt += 1
        max_cnt = max(max_cnt, cnt)

print(max_cnt)

Submission status: Accepted

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

Submission status: Accepted

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

import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union
# import time
# import math, cmath
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import _heapify_max, _heappop_max, _siftdown_max
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import Fraction               # Fraction(a, b) => a / b ∈ Q. note: Fraction(0.1) do not returns Fraciton(1, 10). Fraction('0.1') returns Fraction(1, 10)



def main():
    Num = Union[int, float]
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79e+308
    # inf = 2 ** 63 - 1             # (for fast JIT compile in PyPy) 9.22e+18
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input():  return sys.stdin.readline().rstrip()
    def ii():     return int(input())
    def isp():    return input().split()
    def mi():     return map(int, input().split())
    def mi_0():   return map(lambda x: int(x)-1, input().split())
    def lmi():    return list(map(int, input().split()))
    def lmi_0():  return list(map(lambda x: int(x)-1, input().split()))
    def li():     return list(input())
    def debug(x): print(x, file=sys.stderr)
    # def _heappush_max(h, item): h.append(item); _siftdown_max(h, 0, len(h)-1)
    
    
    s = input()
    cnt = s.count('R')
    if cnt == 2 and s[1] == 'S':
        print(1)
    else:
        print(cnt)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = input()
count = 0
mx = 0
for i in range(len(n)):
  if n[i] == "R":
    count +=1
  else:
    count = 0
  mx = max(mx,count)
print(mx)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
R_check = lambda x: 1 if x=="R" else 0
rain_flg = list(map(R_check, S))
if sum(rain_flg) == 2:
  if rain_flg[1] == 0:
    print(1)
  else:
    print(2)
else:
  print(sum(rain_flg))

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())
s=s.lower()

if s=="rrr":
    print('3')
elif s.find('rr') != -1:
    print("2")
elif s.find('r') != -1:
    print("1")
else:
    print ("0")

Submission status: Accepted

Solution code:
a=lambda x:x.count("R") if x.count("R") in{0,1,3}else 1 if x=="RSR"else 2
print(a(input()))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
res = 0

for i in range(3):
    if s[i] == 'R':
        res = 1
if s[0] == 'R' and s[1] == 'R':
    res += 1
if s[1] == 'R' and s[2] == 'R':
    res += 1

print(res)

Submission status: Accepted

Solution code:
from sys import stdin,stdout
def INPUT():return list(int(i) for i in stdin.readline().split())
def inp():return stdin.readline()
def out(x):return stdout.write(x)
import math
INT_MIN=-10**13
import bisect as B
###############################################################################\
s=input()

cr=0
cs=0
for i in range(len(s)):
    if s[i]=="R":
        cr+=1
    else:
        cs+=1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = input("") 
if weather == "RRR":
   print(3)
elif weather == "SRR":
   print(2)
elif weather == "RSR":
   print(1)
elif weather == "RRS":
   print(2)
elif weather == "SSR":
   print(1)
elif weather == "RSS":
   print(1)
elif weather == "SRS":
   print(1)
elif weather == "SSS":
   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:
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:
# AtCoder Beginner Contest 175
# A - Rainy Season

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = input()
if x == 'SSS':
  print(0)
elif 'SS' in x:
  print(1)
elif 'RRR' in x:
  print(3)
elif 'SRS' in x or 'RSR' in x:
  print(1)
else:
  print(2)

Submission status: Accepted

Solution code:
# AtCoder Beginner Contest 175
# A - Rainy Season

S=input()

ans=0

for i in range (len(S)):
    if S[i]=="R":
        tempans=1
        for j in range (i+1,len(S)):
            if S[i]==S[j]:
                tempans+=1
            else:
                if tempans>ans:
                    ans=tempans
                break
        else:
            if tempans>ans:
                ans=tempans
print(ans)

Submission status: Accepted

Solution code:
S = input()
# RC = S.count('R')
# if S[1] == 'S' and RC == 2:
    # print(1)
# else:
    # print(RC)

rs = S.split('S')
ans = 0
for r in rs:
    ans = max(ans, len(r))
print(ans)

Submission status: Accepted

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

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	s=RD()
	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)




if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
s = input()
cnt = 0
if s.count('R') == 3:
  print(3)
  exit()
elif s[1] == 'R' and (s[0] == s[1] or s[1] == s[2]):
  print(2)
  exit()
elif s.count('R') >= 1:
  print(1)
  exit()
else:
  print(0)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    S = input().strip()

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

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:
S = input()
if S == "RSR" or S == "RSS" or S == "SRS" or S == "SSR":
    print(1)
    exit(0)
if S == "RRS" or S == "SRR":
    print(2)
    exit(0)
if S == "RRR":
    print(3)
    exit(0)
print(0)
exit(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:
S=input()
if S=="RSR":
  print(1)
else:
  print(S.count("R"))

Submission status: Accepted

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

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();print(sum("R"*i in s for i in range(1,4)))

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
s = input()

for i in [3, 2, 1, 0]:
    if 'R' * i in s:
        print(i)
        break

Submission status: Accepted

Solution code:
st = input()
if st[0] == st[1] and st[0] == st[2] and st[0] == "R":
  print(3)
elif (st[0] == st[1] and st[0] == "R") or (st[1] == st[2] and st[1] == "R"):
  print(2)
elif "R" in st:
  print(1)
else:
  print(0)

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:
from math import *
import sys,bisect,copyreg,copy,statistics,os
def inp(): return sys.stdin.readline().strip()
def IIX(): return (int(x) for x in sys.stdin.readline().split())
def II(): return (int(inp()))
def LI(): return list(map(int, inp().split()))
def LS(): return list(map(str, inp().split()))
def L(x):return list(x)
def out(var): return sys.stdout.write(str(var))
def binary_search(arr, x): 
    left = 0
    right = len(arr) - 1
    mid = 0
    while left <= right:   
        mid = (left + left) // 2
        if arr[mid] < x: 
            left = mid + 1
        elif arr[mid] > x: 
            right = mid - 1
        else: 
            return mid
    return -1
 
s=inp()
c=0
if s.count("R")==1:
    out(1)
else:
    for i in range(3):
        if s[i]=='R':
            c+=1
        elif s[i]=='S' and i!=2:
            c= 0
    out(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

count = S.count('R')

if count == 0 or count == 1 or count == 3:
    print(count)
else:
    if S == 'RSR':
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
from sys import exit, stdin

# import copy
# from collections import deque,Counter
# import numpy as np
# input = stdin.readline

S = input()

cnt = 0
for s in S:
    if s == "R":
        cnt += 1
    elif cnt>0 and s=="S":
        break
print(cnt)

Submission status: Accepted

Solution code:
s = input()

if s[0] == s[1] == s[2] == "R":
    ans = 3
elif s[0] ==s[1] =="R" or s[1] ==s[2] =="R":
    ans = 2
elif "R" in s:
    ans = 1
else:
    ans = 0

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:
import sys
input = sys.stdin.readline

s = list(input())

res = 0
t = 0
for e in s:
    if e == 'R':
        t += 1
    else:
        res = max(res,t)
        t = 0

res = max(res,t)
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
wt = str(input())
if wt == 'SSS':
    print(0)
elif wt == "RRR":
    print(3)
else:
    id = wt.index('R')
    if wt.count('R') == 2 and wt[id] == wt[id+1] == 'R':
        print(2)
    else:
        print(1)

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)