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

for i in range(len(S)):
  if S[i] == 'S':
    cnt = 0
  else:
    cnt += 1
    
  ans = max(ans, cnt)
  
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()
c=0
if(s[0]=='R' and s[1]=='R' and s[2]=='R'):
  c=3
elif((s[0]=='R' and s[1]=='R') or (s[1]=='R' and s[2]=='R')):
  c=2
elif (s[0]=='R' and s[2]=='R'):
  c=1
elif(s[0]=='R' or s[1]=='R' or s[2]=='R'):
  c=1
print(c)

Submission status: Accepted

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

print(x)

Submission status: Accepted

Solution code:
s = input().split('S')
s = sorted(s, reverse=True)
print(len(s[0]))

Submission status: Accepted

Solution code:
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    s = kwargs["s"]
    if s == "SSS":
        res = 0
    elif s == "RRR":
        res = 3
    elif s == "RRS" or s == "SRR":
        res = 2
    else:
        res = 1
    return res

if __name__ == "__main__":
    kwargs = {}

    cin = input().split()
    kwargs["s"] = cin[0]

    cout = main(kwargs)
    print(cout)

Submission status: Accepted

Solution code:
S = input()

flg = True

if 'RRR' in S and flg:
    flg = False
    print(3)

elif 'RR' in S and flg:
    flg = False
    print(2)

elif 'R' in S and flg:
    flg = False
    print(1)

else: print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin
n = stdin.readline().rstrip()
num = []
tmp = 0
for tenki in n:
    if tenki == 'S':
        num.append(tmp)
        tmp = 0

    else :
        tmp += 1
num.append(tmp)

print(max(num))

Submission status: Accepted

Solution code:
s=input()
if s.count("R")==0:
	print(0)
elif s.count("RR")==0:
	print(1)
elif s.count("RRR")==0:
	print(2)
elif s.count("RRR")==1:
	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:
n=input()
flag=1
cnt=0
for i in range(3):
    if flag==0:
        if n[i]=="R":
            cnt+=1
        else:
            flag+=1
            break
    else:
        if n[i]=="R":
            cnt+=1
            flag=0
print(cnt)

Submission status: Accepted

Solution code:
S = list(input())

ans=0
ans_list=[]
for s in S:
    if s == 'R':
        ans += 1
    elif s == 'S':
        ans_list.append(ans)
        ans = 0
        
ans_list.append(ans)      
        
print(max(ans_list))

Submission status: Accepted

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

Submission status: Accepted

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

s = input()
cnt = 0

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()
a=1
count=0
for i in range(len(S)):
    if(S[i]=='R') :
        if(count==0):
            a=1
            count=count+1
        elif(S[i-1]=='R'):
            count=count+1

print(count)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
def main():
    S = input()

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


if __name__ == '__main__':
    main()

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")
    exit()
    
if s[1] == "R":
    if s[2] == "R":
        print("2")
    else:
        print("1")
    exit()

if s[2] == "R":
    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:
S = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ans=0


if 'RR' in s:
    ans=2
else:
    ans=1

if not 'R' in s:
    ans=0

if s=='RRR':
    ans=3
print(ans)

Submission status: Accepted

Solution code:
S=input()
ans=0
temp=0
for x in S:
  if x=="R":
    temp+=1
  else:
    ans=max(ans,temp)
    temp=0
  ans=max(ans,temp)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
String = input()
if String[1]=='R':
  print(String.count('R'))
elif String.count('R')>=1:
  print('1')
else:
  print('0')

Submission status: Accepted

Solution code:
A = str(input())
sum=0
for i in range(3):
    if A[i]=="R":
        if A[i-1]=="R":
            sum+=1
        else:
            sum=1
        
print(sum)

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
sys.setrecursionlimit(500*500)
import itertools
from collections import Counter,deque

def main():
    s = input().rstrip()
    if s == "RRR":
        print(3)
    elif s == "RRS" or s == "SRR":
        print(2)
    elif s == "SSS":
        print(0)
    else:
        print(1)





if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
S = input()

s = S.count('R')
if s==2 and S[0] == 'R' and S[2] == 'R':
    s -= 1

print(s)

Submission status: Accepted

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

print(max)

Submission status: Accepted

Solution code:
import sys
si = sys.stdin.readline


def main():
    s = si()[:-1]
    m, cnt = 0, 0
    for e in s:
        if e == 'R':
            cnt += 1
        elif e == 'S':
            cnt = 0
        m = max(m, cnt)
    print(m)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# print('input >>')
S = input()

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

# print('-----output-----')

Submission status: Accepted

Solution code:
s = input()
ans = 0
tmp = 0
for c in s:
  if c == 'S':
    tmp = 0
  else:
    tmp += 1
  if tmp > ans:
    ans = tmp
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# vim: fileencoding=utf-8


def main():
    s = list(input())
    c = 0
    p = "S"
    r = 0
    for e in s:
        if e == "R":
            c += 1
        if c > r:
            r = c
        if e == "S":
            c = 0
    print(r)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

maxcount = 0
count = 0
for i in s:
    if(i=='R'):
        count+=1
    else:
        count= 0
    maxcount = max(count,maxcount)
print(maxcount)

Submission status: Accepted

Solution code:
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=tf-8
#

"""
"""

from collections import defaultdict
import bisect

import sys
input = sys.stdin.readline

def solve(s):
    ans = 0
    tmp = 0
    for ss in s:
        if ss == 'R':
            tmp += 1
            ans = max(ans,tmp)
        else:
            tmp = 0
    print(ans)

            

def main():
    s = input().rstrip()
    solve(s)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s = input()

def ans(a):
    if s == 'RSR':
        return 1
    else:
        return (s[0] == 'R') + (s[1] == 'R') + (s[2] == 'R')

print(ans(s))

Submission status: Accepted

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

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

if s == "SSS":
  print("0")

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

elif s.count("R") ==1 or s == "RSR":
  print("1")

else:
  print("2")

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:

S = input()

cnt = 0
for i in range(3):
    if S[i] == "R":
        cnt += 1
    
    if cnt > 0 and S[i] == "S":
        break

print(cnt)

Submission status: Accepted

Solution code:
# 初期入力
import sys
#input = sys.stdin.readline  #文字列では使わない

S =input().strip()
ans =0
if S =="RRR":
    ans =3
elif S[:2]=="RR" or S[1:]=="RR":
    ans =2
elif S[0] =="R" or S[1] =="R" or S[2] =="R":
    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:
S=input()
if S=="RRR":
    print(3)
elif S=="SSS":
    print(0)
elif S=="SSR" or S=="RSS" or S=="SRS" or S=="RSR":
    print(1)
else:
    print(2)

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:
s = input()
cnt = 0

if 'RRR' in s:
    print(3)
    exit()
if 'RR' in s:
    print(2)
    exit()
if 'R' in s:
    print(1)
    exit()

print(0)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
#import string
#from collections import defaultdict, deque, Counter
#import bisect
#import heapq
#import math
#from itertools import accumulate
#from itertools import permutations as perm
#from itertools import combinations as comb
#from itertools import combinations_with_replacement as combr
#from fractions import gcd
#import numpy as np

stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
MIN = -10 ** 9
MOD = 10 ** 9 + 7
INF = float("inf")
IINF = 10 ** 18

def solve():
    n = str(stdin.readline().rstrip())
    #A, B, C = map(int, stdin.readline().rstrip().split())
    #l = list(map(int, stdin.readline().rstrip().split()))
    #numbers = [[int(c) for c in l.strip().split()] for l in sys.stdin]
    #word = [stdin.readline().rstrip() for _ in range(n)]
    #number = [[int(c) for c in stdin.readline().rstrip()] for _ in range(n)]
    #zeros = [[0] * w for i in range(h)]
    ans = 0
    for i in range(3):
        if n[i] == "R":
            if i != 2 and n[i+1] == "R":
                if i == 0 and n[i+2] == "R":
                    ans = 3
                    break
                else:
                    ans = 2
                    break
            else:
                ans = 1
        else:
            pass
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
raw = input()
weather = list(raw)
c = weather.count("R")

if c != 2:
  print(c)
elif raw == "RRS" or raw == "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=='RSS' or S=='SRS' or S=='SSR' or S=='RSR':
  print(1)
else:
   print(0)

Submission status: Accepted

Solution code:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

def solve():
    return

if __name__=='__main__':
    s = S()
    if s=="RRR":
        print(3)
    elif s=="RRS" or s=="SRR":
        print(2)
    elif s=="SSS":
        print(0)
    else:
        print(1)
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

cnt = 0
cnt2 = []
flag = False
for i in range(3) :
    if S[i] == 'R' :
        if flag == True :
            cnt += 1
        else :
            cnt = 1
            flag = True
    else :
        cnt = 0
        flag = False
    cnt2.append(cnt)

print(max(cnt2))

Submission status: Accepted

Solution code:
X = input()
ans = 0
flag = True
for x in X:
    if flag:
        if x == "R":
            ans += 1
            flag = False
    else:
        
        if x == "R":
            ans += 1
        else:
            break
print(ans)

Submission status: Accepted

Solution code:
s = input()
ans = 0
x = list(s).count("R")

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

Submission status: Accepted

Solution code:
s = input()

count = 0
bef = ""
maxC = 0
for i in range(len(s)):
    if bef == "" and s[i] == "R":
        count+=1
    else:
        if s[i] == "R" and bef == "R":
            count+=1
        elif s[i] == "R" and bef == "S":
            if count > maxC:
                maxC = count
            count = 1
        elif s[i] == "S" and bef == "R":
            if count > maxC:
                maxC = count
            count = 0
        else:
            count = 0
    bef = s[i]
if count > maxC:
    maxC = count
print(maxC)

Submission status: Accepted

Solution code:
S = input().strip()

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()
hola=0
mysy=[]
for i in range(len(s)):
    if(s[i]=="R"):
        hola+=1
    else:
        if(hola!=0):
            mysy.append(hola)
            hola=0
    mysy.append(hola)
print(max(mysy))

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

Solution code:
import sys

s = input()

ans = 0

for _s in range(3, 0, -1):
    if _s * "R" in s:
        print(_s)
        sys.exit()

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)
    exit()
else:
    print(s.count('R'))

Submission status: Accepted

Solution code:
S = input()

rst = 0
for i in range(0,3):
  cnt = 0
  if S[i] == "R":
    cnt += 1
    for j in range(i+1,3):
      if S[j] == "R":
        cnt+= 1
      else:
        break
  rst = max(rst,cnt)
print(rst)

Submission status: Accepted

Solution code:
s = str(input())

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

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())
cnt = 0
maxCnt = 0

for i in range(3):
    if S[i] == "R":
        cnt += 1
    else:
        cnt = 0
    if maxCnt < cnt:
        maxCnt = cnt

print(maxCnt)

Submission status: Accepted

Solution code:
s = input()

tmp = s.replace('S', '')

if len(tmp) == 2:
  if s == "RSR":
    print(1)
  else:
    print(2)

else:
  print(len(tmp))

Submission status: Accepted

Solution code:

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

    max = 0
    count = 0
    for c in s:
        if c == "R":
            count += 1
        else:
            if max < count:
                max = count
                count = 0
    
    if max < count:
        max = count

    print(str(max))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
s=input()
count=0
key=0

for i in range(3):
    if key==0:
        if s[i]=='R':
            count=1
            key=1
            continue
    if key==1:
        if s[i]=='R':
            count+=1
        if s[i]=='S':
            break

print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
word = input()

res = 0
count = 0
for s in word:
    if s == 'R':
        count += 1
    else:
        if res < count:
            res = count
        count = 0
if res < count:
    res = count
print(res)

Submission status: Accepted

Solution code:

weth = input()

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

Submission status: Accepted

Solution code:
s = input()


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

Submission status: Accepted

Solution code:
n = input().split('S')
print(len(sorted(n,key=len, reverse=True)[0]))

Submission status: Accepted

Solution code:
from sys import stdin,stdout
from collections import defaultdict
import math
#input=stdin.readline
#def print(x):stdout.write(str(x)+'\n')
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:
# -*- coding: utf-8 -*-
 
## Library
 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 
## input
 
# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))
 
S = input()

tmp = 0
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np


def solve(S: str):
    if S=="SSS":
        print(0)
        return
    if S=="SSR" or S=="SRS" or S=="RSS" or S=="RSR":
        print(1)
        return
    if S=="SRR" or S=="RRS":
        print(2)
        return
    else:
        print(3)
        return

    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:

S = input()

now = 0
ans = 0
for i in S:
    if i == "R":
        now += 1
        ans = max(now , ans)
    else:
        now = 0

print (ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

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 = str(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:
import sys

def I(): return int(sys.stdin.readline().rstrip())
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())

tenki = input()

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

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

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

Submission status: Accepted

Solution code:
S=list(str(input()))
count,maxc= 0,0
for i in range(len(S)):
    if S[i]== "R":
        count += 1
    else:
        if maxc < count:
            maxc = count
        count = 0
if maxc < count:
    maxc = count
print(maxc)

Submission status: Accepted

Solution code:
s = input()

answer = 0
count = 0
for i in range(len(s)):
  if s[i] == "R":
    count += 1
    if i == len(s)-1 :
      if count > answer :
        answer = count  
  else :
    if count > answer :
      answer = count
    count = 0
  
print(answer)

Submission status: Accepted

Solution code:
ss = str(input())

numr = ss.count('R')

if (numr == 2) and (ss[1]=='S'):
    print(1)
else:
    print(numr)

Submission status: Accepted

Solution code:
s = input()
ans = 0

if s.find("RRR") >= 0:
    ans = 3
elif s.find("RR") >= 0:
    ans = 2
elif s.find("R") >= 0:
    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:
s1=input()
if s1[1]=="S" and s1.count("R")==2:
   print(1)
else:
    print(s1.count("R"))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# from numba import njit

# input = stdin.readline

# @njit
def solve(s):
  res = 0
  cnt = 0
  for i in range(3):
    if s[i] == "R":
      cnt += 1
    else:
      res = max(res,cnt)
      cnt = 0
  res = max(res,cnt)

  return res



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()

Submission status: Accepted

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

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
else:
    if s[1]=="R":
        count += 1
        if s[2]=="R":
            count +=1
    else:
        if s[2]=="R":
            count +=1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

s = input().split('S')
print(len(max(s)))

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()
 
ans = 1

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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:
N = input()

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = input()
ans = 0
a = 0
for si in s:
    if si == "R":
        a += 1
    else:
        ans = max(ans,a)
        a = 0
print(max(ans,a))

Submission status: Accepted

Solution code:
S=input()
if S.count("RRR"):
  D=3
elif S.count("SSS"):
  D=0
elif S.count("RR"):
  D=2
else:
  D=1
print(D)