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

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

Submission status: Accepted

Solution code:
s=input()
ans=0
for i in range(1,4):
	if s.count("R"*i):
		ans=max(ans,i)
print(ans)

Submission status: Accepted

Solution code:
W = input()
if W == 'RRR':
    print(3)
elif W == 'SSS':
    print(0)
elif any([W == 'RRS',  W == 'SRR']):
    print(2)
else:
    print(1)

Submission status: Accepted

Solution code:
S = str(input())

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

Submission status: Accepted

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

ma = max(count, ma)
print(ma)

Submission status: Accepted

Solution code:
s=input()
if s=="RSR":
    print(1)
    exit()
elif s!="RSR":
    cnt=0
    for i in range(3):
        if s[i]=="R":
            cnt+=1
    print(cnt)

Submission status: Accepted

Solution code:
import itertools

S = input()
print(max((len(list(g)) for k, g in itertools.groupby(S) if k == 'R'), default=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 s.count('RR') == 1:
    print(2)
elif s.count('R') >= 1:
    print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')

    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:
l=list(input())
if l[0]=='R':
  if l[1]=='R':
    if l[2]=='R':
      print(3)
    else:
      print(2)
  else:
      print(1)
else:
  if l[1]=='R':
    if l[2]=='R':
      print(2)
    else:
      print(1)
  else:
    if l[2]=='R':
      print(1)
    else:
      print(0)

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

r = S.count("R")

if S == "RSR":
    r -= 1

print(r)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()
cnt = 0
current = 0
for idx in range(len(S)):
  if S[idx] == "R":
    current = current + 1
  else:
    current = 0
  
  if cnt < current:
    cnt = current
print(cnt)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
count = 0
s = str(input())
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:
S=input()
cnt=0
if S=="RRR":
    print(3)
elif S=="RRS":
    print(2)
elif S=="RSR":
    print(1)
elif S=="SRR":
    print(2)
elif S=="SSS":
    print(0)
else:
    print(1)

Submission status: Accepted

Solution code:
data = input()

continuous = 0
is_before_rain = False
for i in range(3):
  if data[i] == 'R' and is_before_rain:
    continuous += 1
  if data[i] == 'R':
    is_before_rain = True
  else:
    is_before_rain = False

print( continuous + int('R' in data) )

Submission status: Accepted

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

S=input().strip()

if not ("R" in S):
    print(0)
elif S[1]!="R":
    print(1)
else:
    A=1
    if S[0]=="R":
        A+=1
    if S[2]=="R":
        A+=1

    print(A)

Submission status: Accepted

Solution code:
#Problem A

S = list(input())
cnt = [0]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
o = 0
if 'R' in a[:]:
  o += 1
for i in range(2):
  if a[i] == 'R' and a[i+1] == 'R':
    o += 1
print(o)

Submission status: Accepted

Solution code:
s=input()
c=0
f=0
if s.count('R')==3:
  print(3)
  f=1
if s.count('R')<=1 and f==0:
  print(s.count('R'))
  f=1

if s[0]=='R' and s[1]=='R' and f==0:
  print(2)
  f=1
if s[1]=='R' and s[2]=='R' and f==0:
  print(2)
  f=1
if f==0:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
n = len(s)
count = 0
loc = 0
for i in s:
    if i == 'R':
        loc+=1
    else:
        loc = 0
    count = max(count, loc)
print(count)

Submission status: Accepted

Solution code:
S = input()

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

ans = 0
if a == 0:
    ans = 0
elif a == 1:
    ans = 1
elif a == 2:
    if S[1] == "R":
        ans = 2
    else:
        ans = 1
else:
    ans = 3

print(ans)

Submission status: Accepted

Solution code:
s=input()

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

Submission status: Accepted

Solution code:
def main():
    ss = list(input())
    r_count = ss.count("R")
    if r_count == 2 and ss[0] == "R" and ss[2] == "R":
        ans = 1
    else:
        ans = r_count
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
l=list(str(input()))
l.insert(0,"S")
ans=0
tot=0
for i in range(4):
    if(l[i]=="R"):
        if(l[i-1]=="R"):
            ans+=1
            if(ans>tot):
                tot=ans
        elif(l[i-1]=="S"):
            ans=1
            if(ans>tot):
                tot=ans
print(tot)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
l=[]
count=0
for i in range(3):
    if s[i]=='R':
        count+=1
    else:
        l.append(count)
        count=0 
    if i==2 and s[i]=='R':
        l.append(count)
print(max(l))

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:
import sys

S=input()
ans=0
ans=S.count("R")
if ans==2 and S[1]=="S":
    print("1")
    sys.exit()
print(ans)

Submission status: Accepted

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

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

    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a = (input())
    if a.find("RRR")!=-1:
        print(3)
    elif a.find("RR")!=-1:
        print(2)
    elif a.find("R")!=-1:
        print(1)
    else:
        print(0)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = list(input())

t = 0
max_t = 0

for i,s in enumerate(S):
    if s == 'R' and t == 0:
        t = 1
    elif s == 'R' and S[i-1] == 'R':
        t+=1
    else:
        t = 0
    max_t = max(max_t,t)
print(max_t)

Submission status: Accepted

Solution code:
k = input()

if 'R' not in k:
    print(0)

elif k == 'RRS' or k == 'SRR':
    print(2)

elif k == 'RRR':
    print(3)

else:
    print(1)

Submission status: Accepted

Solution code:
S = list(input())

count = 0
flag = 0

if S[0] == "R":
    flag = 1

for x in range(1,len(S)):
    if S[x] == "R":
        flag = 1
    if S[x-1] == "R" and S[x] == "R":
        count += 1

print(count + flag)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s=input()

ans=0
if s[0]=="R":
    ans+=1
    if s[1]=="R":
        ans+=1
        if s[2]=="R":
            ans+=1
elif s[1]=="R":
    ans+=1
    if s[2]=="R":
        ans+=1
elif s[2]=="R":
    ans+=1

print(ans)

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

count = 0
ans = 0
ansR = 0
for s in S:
  if s == "R":
    count += 1
    ansR = count
  else:
    ans = count
    count = 0


print(max(ans, ansR))

Submission status: Accepted

Solution code:
def main():
    S = input()
    if S.count('R') != 0:
        out = 1
    else:
        out = 0
    if S == 'RRR':
        out = 3
    if (S == 'SRR') or (S == 'RRS'):
        out = 2
    print(out)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

import sys
import glob

class InputGenerator(object):
    def __init__(self, input_path=None):
        if input_path != None:
            self.g = self.input_generator(input_path)
        else:
            self.g = None

    def input_generator(self, input_path):
        with open(input_path) as f:
            for line in f:
                yield line

    def get_input(self):
        if self.g == None:
            return input()
        else:
            return next(self.g)

def solve(gen):
    l = gen.get_input().rstrip()
    num_days = 0
    num_days_max = 0
    for s in l:
        if s == 'R':
            num_days += 1
        else:
            if num_days > num_days_max:
                num_days_max = num_days
            num_days = 0

    if num_days > num_days_max:
        num_days_max = num_days

    print(num_days_max)

if __name__ == '__main__':
    test_flag = len(sys.argv) > 1

    if test_flag == True:
        file_path_list = sorted(glob.glob('test/*'))
    else:
        file_path_list = [None]

    for file_path in file_path_list:
        gen = InputGenerator(file_path)
        solve(gen)

Submission status: Accepted

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

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 == 'RRS' or S == 'SRR':
        print(count)
    elif S == 'RSR':
        print(1)

Submission status: Accepted

Solution code:
S = input()
W = ['SSS','SSR','SRS','SRR','RSS','RSR','RRS','RRR']
D = [0,1,1,2,1,1,2,3]
print(D[W.index(S)])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
while True:
    try:
        x=input()
        p=0
        if x=='SRR'or x=="RRS":
            print(2)
        elif x=="RRR":
            print(3)
        elif x=='SSS':
            print(0)
        else:
            print(1)
    except:
        break

Submission status: Accepted

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

Submission status: Accepted

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

    cnt = 0
    if s[0] == 'R':
        cnt = 1

    if s[1] == 'R':
        if s[0] == 'R':
            cnt = 2
        else:
            cnt = 1

    if s[2] == 'R':
        if s[0] == 'R' and s[1] == 'R':
            cnt = 3
        elif s[1] == 'R':
            cnt = 2
        else:
            cnt = 1

    print(cnt)    

 

if __name__ == '__main__':
    main()

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

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" and S[2]!="R":
	print(2)
    
elif S[0]!="R" and S[1]=="R" and S[2]=="R":
	print(2)
    
elif S[0]=="R" and S[1]!="R" and S[2]=="R":
	print(1)
    
elif S[0]=="R" and S[1]!="R" and S[2]!="R":
	print(1)
    
elif S[0]!="R" and S[1]=="R" and S[2]!="R":
	print(1)
    
elif S[0]!="R" and S[1]!="R" and S[2]=="R":
	print(1)
    
else:
	print(0)

Submission status: Accepted

Solution code:
s = input()
# print(s)
s_list = list(s)
# print(s_list)

ans  = 0
number_of_consecutive_times = 0
for ss in s_list:
    if ss == 'R':
        number_of_consecutive_times += 1
    else:
        number_of_consecutive_times = 0
    ans = max(ans, number_of_consecutive_times)
print(ans)

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import math


debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        for line in sys.stdin:
            lines.append(line.strip())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    s = lines[0]
    

    return (s, )


def solve(s):

    result = None
    if s == 'RRS' or s == 'SRR':
        result = 2
    elif s == 'RRR':
        result = 3
    elif s == 'SSS':
        result = 0
    else:
        result = 1
        
    return result
    


def main():
    # 出力
    result = solve(*parse_input())
    if isinstance(result, list):
        for r in result:
            print("%s" % r, sep='')
    else:
        print("%s" % result, sep='')

if __name__ == '__main__':

    main()

Submission status: Accepted

Solution code:
S=list(input())
a,b=0,0
for i in S:
    if i=="R":
        a+=1
    else:
        if a>b:
            b=a
        a=0
if a>b:
    b=a
print(b)

Submission status: Accepted

Solution code:
def resolve():
    s = list(input())
    cnt = 0
    m_cnt = 0
    for c in s:
        if c == 'R':
            cnt += 1
            if cnt > m_cnt:
                m_cnt = cnt

        else:
            cnt = 0

    print(m_cnt)

resolve()

Submission status: Accepted

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

Submission status: Accepted

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

    return m

print(main())

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

s = input()

c = 0
r = 0

for i in range(3):
	if s[i] == 'R':
		c += 1
		if r < c:
			r = c
	else:
		c = 0

print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())

num=sum([i=='R' for i in s])
if num==2:
  if s[1]!='R':num=1
print(num)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
s = input()
rain = 0
count = 0
for i in s:
    if i == "R":
        count+=1
    else:
        rain = max(rain, count)
        count = 0
rain = max(rain, count)
print(rain)

Submission status: Accepted

Solution code:
s_in = str(input())
s = list(s_in)
ans = 0
rain = 0
for i in range(3):
    if s[i]== 'R':
        if rain == 1:
            ans += 1
        else:
            ans = 1
        rain = 1
    else:
        rain = 0
print(ans)

Submission status: Accepted

Solution code:
s = input()
ans = 0
if s.count('R') > 0:
    ans = 1
if s[0] == 'R' and s[1] == 'R':
    ans = 2
if s[2] == 'R' and s[1] == 'R':
    ans = 2
if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
    ans = 3
print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s=input()
s=str(s)
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]=='S' and s[1]=='S' and s[2]=='S'):
  print(0)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

S=str(input())

Sa=S.split("S")
ans=0
for i in Sa:
    if ans<len(i):
        ans=len(i)
print(ans)

Submission status: Accepted

Solution code:
def main():
    S = str(input())
    A0 = ('SSS')
    A1 = ('RSS','SRS','SSR','RSR')
    A2 = ('RRS','SRR')
    A3 = ('RRR')
    if S in A0:
        print(0)
    elif S in A1:
        print(1)
    elif S in A2:
        print(2)
    elif S in A3:
        print(3)
    
if __name__ == '__main__':
    main()

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:
a = str(input())
ans = 0
count = 0
if a[1] == "R" :
  count = count + 1
  if a[0] == "R" and a[2] == "R" :
    count = count + 2
  elif a[0] == "S" and a[2] == "S" :
    count = 1
  else :
    count = count + 1
else :
  if a[0] == "R" and a[2] == "R" :
    count = count + 1
  elif a[0] == "S" and a[2] == "S" :
    count = 0
  else :
    count = count + 1
ans = count
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
s = input()

if s == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
else:
    for i in range(3):
        if s[i] == "R":
            print(1)
            break
        elif i == 2:
            print(0)

Submission status: Accepted

Solution code:
s = str(input())
count = 0
lst = []

for i in range(3):
    if s[i] == 'R':
        count += 1
    else:
        lst.append(count)
        count = 0

    if i == 2:
        lst.append(count)

max_count = max(lst)
print(max_count)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
string = input()
count = 0
max_count = 0
for s in string:
    if s == 'R':
        count += 1
    else:
        if count > max_count:
            max_count = count
        count = 0

    if count > max_count:
            max_count = count

print(max_count)

Submission status: Accepted

Solution code:
rs = list(input())


s_count = rs.count('S')
ans = 0

if s_count == 1:
    if rs[1] == 'S':
        ans = 1
    else:
        ans = 2
elif s_count == 2:
    ans = 1
elif s_count == 0:
    ans = 3
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()
suc=0
ans=0
for i in range(3):
    if S[i]=='R':
        suc+=1
        ans=max(ans,suc)
    else:
        suc=0
print(ans)

Submission status: Accepted

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

if S == "RRR":
  ans = 3
elif S == "RSR":
  ans = 1
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

x=s.count('R')

if s[1]=='S':
  if x==2:
    x-=1
    
print(x)

Submission status: Accepted

Solution code:
S = input()
count = S.count("R")

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

Submission status: Accepted

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