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

Submission status: Accepted

Solution code:
# coding: utf-8
import math
S = (input())

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

Submission status: Accepted

Solution code:
S = input()
rain = False
count = 0
maxC = 0
for i in range(len(S)):
    if (S[i] == 'R'):
        count += 1
        rain = True
    else:
        rain = False
        if maxC < count:
            maxC = count
        count = 0
if maxC < count:
    maxC = count


print(maxC)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    S = lines[0]
    # X = int(lines[0])
    # N, M = list(map(int, lines[0].split()))
    # values = list(map(int, lines[0].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(N):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(N):
    #     valueses.append(list(map(int, lines[i+1].split())))

    if S == 'SSS':
        result = 0
    elif S == 'RRR':
        result = 3
    else:
        if 'RR' in S:
            result = 2
        else:
            result = 1

    return [result]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['RRS']
        lines_export = [2]
    if pattern == 2:
        lines_input = ['SSS']
        lines_export = [0]
    if pattern == 3:
        lines_input = ['RSR']
        lines_export = [1]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math
from functools import lru_cache
from collections import defaultdict
sys.setrecursionlimit(500000)
MOD = 10**9+7

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

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

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    S = input()
    r = S.count('R')
    if r == 0:
        print(0)
    elif r == 1:
        print(1)
    elif r == 2:
        print(2 if 'RR' in S else 1)
    else:
        print(3)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
count = 0
c = 0
for i in S:
  if i == "R":
    count += 1
  else:
    if count > c:
      c = count
      count = 0
if count > c:
      c = count
print(c)

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 not 'S' in S:
    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 = str(input())


result = 0

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

Submission status: Accepted

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

    zero = ["SSS"]
    one = ["RSS","SRS","SSR","RSR"]
    two = ["SRR","RRS"]
    thr = ["RRR"]

    if s in zero:
        print(0)
    elif s in one:
        print(1)
    elif s in two:
        print(2)
    else:
        print(3)
main()

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:
#1
a =input()

res = 0

for i in range(3):
    if a[i] =="R":
        res +=1

if a[1]=="R":
    print(res)

else:
    if res ==2:
        print(1)
    else:
        print(res)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
from math import sqrt
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul, itemgetter
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

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

Submission status: Accepted

Solution code:
s = list(input())
ans = 0

for i in range(3):
    if s[i]=='R':
        if ans==0:
            ans = 1
        else:
            if s[i-1]=='R':
                ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys

S = sys.stdin.readline().strip()
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:
d = input()
t = 0
for i in range(3):
    if d[i] == "R":
        t += 1
if d == "RSR":
    print(1)
else:
    print(t)

Submission status: Accepted

Solution code:
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt
from copy import deepcopy


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

if __name__ == '__main__':
	main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import groupby

s = input()
g = groupby(s)

res = []
for k, v in g:
    res.append((k, str(len(list(v)))))

result = [int(x[1]) for x in res if x[0] == "R"]

ans = 0
if len(result) != 0:
    ans = max(result)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input().strip().split("S")
S.sort()
print(len(S[-1]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S= str(input())

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

else:
    print(S.count('R'))

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:
# -*- coding: utf-8 -*-
a = list(input())
ren = 0
ans = 0

for i in a:
  if i == 'R':
    ren += 1
  else:
    ren = 0
  
  if ren > ans:
    ans = ren

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
if s.count("R") == 0:
    print(0)
elif s.count("RRR") == 1:
    print(3)
elif s.count("RR") == 1:
    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=='RSR' or s=='SRS':
  print(1)
elif s=='SSS':
  print(0)
else:
  print(1)

Submission status: Accepted

Solution code:
# import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)


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

    if 'RRR' in S:
        res = 3
    elif 'RR' in S:
        res = 2
    elif 'R' in S:
        res = 1
    else:
        res = 0

    print(res)



main()

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("R") == 0:
    print(0)
    exit()
if S.count("R") == 3:
    print(3)
elif S.count("R") == 2 and (S[0] == S[1] or S[1] == S[2]):
    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)
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 = str(input())
ans = 0
mx = 0
for i in range(3):
    if s[i] == "R":
        ans += 1
    else:
        if ans > mx:
            mx = ans
            ans = 0
mx = max(mx,ans)
print(mx)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s=input()

cntr=0
for i in range(3):
    if s[i]=="R":
        cntr+=1
    if cntr==0 or cntr==1:
        ans=cntr
    elif cntr==2:
        if s[1]=="R":
            ans=2
        else:
            ans=1
    else:
        ans=3
print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = input()

ans = 0
if "RRR" in 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()
if S=="RSR" or S=="RSS" or S=="SSR" or S=="SRS":
    print(1)
elif S=="SSS":
    print(0)
elif S=="RRR":
    print(3)
else:
    print(2)

Submission status: Accepted

Solution code:
S = input()

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

print(ans)

Submission status: Accepted

Solution code:
s = input().strip().split('S')
print(len(max(s, key = len)))

Submission status: Accepted

Solution code:
S = input()

ans = 0
cnt = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 20:58:20 2020

@author: NEC-PCuser
"""

S = input()

count = 0
ans = 0
for c in S:
	if c == 'R':
		count += 1
		continue
	elif count > ans:
		ans = count
	count = 0

if count > ans:
	ans = count
print(ans)

Submission status: Accepted

Solution code:
#ABC175 A
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 
https://atcoder.jp/contests/abc175/tasks/abc175_a
"""
import sys


def main():
    """Main program."""
    S = sys.stdin.readline().strip()
    run = 0
    max_run = 0
    for c in S:
        if c == 'R':
            run += 1
        else:
            max_run = max(max_run, run)
            run = 0
    max_run = max(max_run, run)
    print(max_run)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = [s for s in open(0)][0]
ans = 0
for s in S:
    if s == 'R':
        ans += 1
if ans == 2 and S[1] != 'R':
    ans -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
weather = list(input())

max_count = 0
count = 0
for w in weather:
  if w == 'R':
    count += 1
    
    if max_count < count:
      max_count = count
      
  elif w == 'S':
    count = 0
    
print(max_count)

Submission status: Accepted

Solution code:
S = input()

tmp = 0
ans = 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()

d = 0
a = [0]
for i in range(3) :
    if S[i] == "R" :
        d += 1
        a.append(d)
    else :
        d = 0

print(max(a))

Submission status: Accepted

Solution code:
#import numpy as np
#import math
#from decimal import *
#from numba import njit

#@njit
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()
count = 0
if s[0] == 'R':
  count += 1
  if s[1] == 'R':
    count += 1
    if s[2] == 'R':
      count += 1
elif s[1] == 'R':
  count += 1
  if s[2] == 'R':
    count += 1
elif s[2] == 'R':
  count += 1
print(count)

Submission status: Accepted

Solution code:
S = list(input())

rain_max = 0
rain_cnt = 0
flag = False
for i in range(len(S)):
    if S[i] == 'R':
        rain_cnt += 1
    else:
        if rain_cnt > rain_max:
            rain_max = rain_cnt
            flag = True
        rain_cnt = 0

if not flag:
    rain_max = rain_cnt

print(rain_max)

Submission status: Accepted

Solution code:
#!/usr/local/bin/python3
S = input()
d = {"RRR": 3, "RRS": 2, "RSR": 1, "RSS": 1, "SRR": 2, "SRS": 1, "SSR": 1, "SSS": 0}
print(d[S])

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

Solution code:
S=input()

R=0
Rmax=0
for i in range(3):
    if S[i] == 'R':
        R+=1
    else:
        if R > Rmax:
            Rmax = R
        R=0
if R > Rmax:
    Rmax = R

print(Rmax)

Submission status: Accepted

Solution code:
input1 = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
strs = input()
ans = 0 
curcount = 0
for i in strs:
    if i == "R":
        curcount += 1 
    else:
        if curcount > ans:
            ans = curcount 
        curcount = 0 
if curcount > ans:
    ans = curcount 
    curcount = 0 
print(ans)

Submission status: Accepted

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

# def
def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(map(int,input().split())))
    return x

def str_mtx(N):
    x = []
    for _ in range(N):
        x.append(list(input()))
    return x

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

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

def print_space(l):
    return print(" ".join([str(x) for x in l]))

# import
import numpy as np



# main code
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
c=0
m=0
flg=False
for x in s:
    if x=="R" and flg:c+=1;m=max(m,c)
    if x=="R" and not flg:
        flg=True
        c=1
        m=max(m,c)
    if x=="S":
        flg=False
        c=0
print(m)

Submission status: Accepted

Solution code:
k = input()

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

Submission status: Accepted

Solution code:
s = str(input())

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

    counter = 0
    maxCounter = 0

    for c in S:
        if c == "R":
            counter = counter + 1

            if counter >= maxCounter:
                maxCounter = counter
        else:
            counter = 0

    print(maxCounter)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()

if s.count("R") in [0,1,3]:
  print( s.count("R") )
else:
  if s == "RSR":
    print(1)
  else:
    print(2)

Submission status: Accepted

Solution code:
S = input()
if S == 'SSS':
   print(0)
elif S == 'RSS':
   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)
else:
   print(3)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

S=(input())

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

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()
res = 0
streak = 0
rs = ""
for s in S:
  if s == 'R':  
    if rs == s:
      res += 1
    else:
      streak = 1
  else:
    streak = 0
  res = max(res, streak)
  rs = s
  
print(res)

Submission status: Accepted

Solution code:
input = raw_input

s = input()

first = True
out = 0
renzoku = 0
for c in s:
    if c == "R":
        if first:
            renzoku = 1
            first = False
        elif fc == "S":
            renzoku = 1
        else:
            renzoku += 1
    else:
        out = max(out, renzoku)
        renzoku = 0
    fc = c

if renzoku != 0:
    out = max(out, renzoku)
print(out)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
x = input()
count = 0
max_count = 0

for s in x:
    if s == "R":
        count += 1
        max_count = count
    else:
        if count > max_count:
            max_count = count
        count = 0
print(max_count)

Submission status: Accepted

Solution code:
import sys

S = input()

ans = 0
if S.count("R") == 3:
    ans = 3
elif S.count("R") == 0:
    ans = 0
elif S.count("R") == 2 and S[1] == "R":
    ans = 2
else:
    ans = 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

result = 0
if S == "RRR":
    result = 3
elif S == "RRS" or S == "SRR":
    result = 2
elif "R" in S:
    result = 1

print(result)

Submission status: Accepted

Solution code:
def main():
    N = str(input())
    #A_list = list(map(int, input().split()))

    if N[0] == "R" :
        if N[1] == "R" :
            if N[2] == "R" :
                print("3")
            else :
                print("2")
        else :
            print("1")
    else :
        if N[1] == "R" :
            if N[2] == "R" :
                print("2")
            else :
                print("1")
        else :
            if N[2] == "R" :
                print("1")
            else :
                print("0")

if __name__ == '__main__':
    main()

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

Submission status: Accepted

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

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

streak = 0
max_streak = 0
for i in s:
  if i == "R":
    streak += 1
    max_streak = max(max_streak, streak)
  else:
    streak = 0
print(max_streak)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
a = 0
for i in s:
  if i == 'R':
    a+=1
if s == 'RSR':
  a = 1
print(a)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def readinput():
    s=input()
    return s

def main(s):
    ans=0
    cont=0
    for c in s:
        if c=='S':
            cont=0
        else:
            cont+=1
            ans=max(cont,ans)
    return ans

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)

Submission status: Accepted

Solution code:
s=list(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)