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: Wrong Answer

Solution code:
""" A
    https://atcoder.jp/contests/abc175/tasks/abc175_a
"""
import sys
import math
from functools import reduce
from bisect import bisect_left

def readString():
    return sys.stdin.readline()

def readInteger():
    return int(readString())

def readStringSet(n):
    return sys.stdin.readline().split(" ")[:n]

def readIntegerSet(n):
    return list(map(int, readStringSet(n)))

def readIntegerMatrix(n, m):
    return [lambda _: readIntegerSet(m) for _ in range(0, n)]

def main(S):
    candidate = 0
    best = 0

    for c in list(S.rstrip()):
        if c == "S":
            if candidate > best:
                best = candidate
            candidate = 0
        else:
            candidate += 1

    return best

if __name__ == "__main__":
    _S = readString()

    print(main(_S))

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

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

for ch in s:
  if ch == 'R':
    n += 1
  else:
    if ans < n:
      ans = n
    n = 0

print(ans)

Submission status: Wrong Answer

Solution code:
i = 0
for s in input():
    if s == "R":
        i += 1
    if i < 2 and i > 0 and s == "S":
        i -= 1

print(i)

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
mozi = input()
if mozi == 'RRR':
    print(0)
elif mozi == 'RRS':
    print(2)
elif mozi == 'SSR':
    print(2)
elif mozi == 'SRS':
    print(1)
elif mozi == 'SSR':
    print(1)
elif mozi == 'RSS':
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
S = input()
if S[0] == 'R':
    if S[1] == 'R':
        if S[2] == 'R':
            print(3)
        else:
            print(2)
    else:
        if S[2] == 'R':
              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: Wrong Answer

Solution code:
S = input('>>>')
num = 0
num_rev = [0,0,0]
for i in range(3):
    if S[i] == 'R':
        num += 1
    elif S[i] == 'S':
        num_rev[i] = num
        num = 0
        

print(max(num,num_rev[0],num_rev[1],num_rev[2]))

Submission status: Wrong Answer

Solution code:

s =list(input()) 
if s.count('R') == 0  :  
    print(0)  
    
elif s.count('R') == 1 or s == 'RSR':          
    print(1)
    
elif s.count('R') == 3 :          
    print(3)    
    
elif s == 'RRS' or s == 'SRR' :
    print(2)

Submission status: Wrong Answer

Solution code:
S=input()
v=0
for i in range(len(S)-1):
    if S[i]==S[i+1]:
        v+=1
    else:
        pass
print(v)

Submission status: Wrong Answer

Solution code:
s = input()


result = 0
flag = False
for rs in s:

    if flag:
        if rs == 'R':
            tmp += 1
        else:
            if tmp > result:
                result = tmp
            flag = False
            
    else:
        if rs == 'R':
            tmp = 1
            flag = True
        
        
print(result)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())

cnt = 0

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

if S[1]=="R":
    cnt += 1
    if S[2]=="R":
        cnt += 1
else:
    if S[2]=="R":
        cnt += 1
    
    
print (cnt)

Submission status: Wrong Answer

Solution code:
line = input().split()

ans = int(0)

for l in line:
	if l is 'S':
		break
	ans += 1

print(ans)

Submission status: Wrong Answer

Solution code:
string=input()

r=0
for i in range(len(string)-1):
  if string[i]=='R' and string[i+1]=='R':
    r+=1
print(r)

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

Solution code:
S = input()
count = 0
for i in range(3):
    if S[i] == "R":
        count += 1
    elif count == 1:
        count = 0
    
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
    else:
        if count > ans:
            ans = count
        count = 0
print(ans)

Submission status: Wrong Answer

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

s=L(inp())
con=0

for i in range(3):
    if s[i]=='R':
        con+=1
    if s[i]=='S':
        con=0

out(con)

Submission status: Wrong Answer

Solution code:
a = input()
m = 0
i = 0
s = 0
while i < len(a) :
    if a[i] == "S" :
        if m < s :
            m = s
        s = 0
    if a[i] == "R" :
        s = s + 1
    i = i + 1
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    s = list(input())
    last = ''
    count = 0
    for i, day in enumerate(s):
        if day == 'S':
            count = 0
        if i == 0:
            count += 1
        elif last == 'R':
            count += 1
        last = day

    print(count)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
_s = input()
last = _s[0]
cnt = 1
for i in range(1, len(_s)):
	if(_s[i] == last):
		if(_s[i] == 'R'):
			cnt += 1
	last = _s[i]
print(cnt)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
 
S = input()
#N = int(input())
#A, B = map(int, input().split())
#List = list(map(int, input().split()))
 
if S=="RRR":
    print(3)
elif S=="RRS":
    print(2)
elif S=="SRR":
    print(2)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
S = input()
ans = 0
for s in range(len(S)):
	if S[s]=="R":
		ans +=1

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

Submission status: Wrong Answer

Solution code:
weather = input()
raincount=0
for  i in range(3):
    if weather[i]=="R":
           raincount=raincount+1
    else:
           raincount=0

print(raincount)

Submission status: Wrong Answer

Solution code:

if __name__ == "__main__":
    s = input()
    S = 0
    R = 0
    for i in s:
        if i == 'S':
            S += 1
        else:
            R += 1
    print(max(S, R))

Submission status: Wrong Answer

Solution code:
s = input().upper()
c = s.count('R')
if c == 3:
  if s.count('RRR') == 1:
    print(3)
  elif s.count('RR') == 1:
  	print(2)
  else:
    print(1)
elif c == 2:
  if s.count('RR') == 1:
    print(1)
  else:
    print(1)
else:
  print(1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = str(input())
ans = 0
if S[0]=="R":
    ans+=1
if S[1]=="R":
    ans+=1
if S[2]=="R":
    if S[1]=="R":
        ans+=1
    ans=1
print(ans)

Submission status: Wrong Answer

Solution code:
x = input()
ans = 0

if x == 'RRR':
  ans = 3
elif x == 'RRS' or 'SRR':
  ans = 2
elif x == "RSS" or "SRS" or "SSR":
  ans = 1
else:
  ans = 0

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = input()
t = x.count("R")
if t != 3 and x[0] == x[2]:
  t -= 1
print(t)

Submission status: Wrong Answer

Solution code:
S = input()
cnt = 0
rain = 0


for i in S:
    if i == "R":
        rain = 1
    else:
        rain = 0
    if rain == 1:
        cnt += 1
    else:
        pass


print(cnt)

Submission status: Wrong Answer

Solution code:
s=str(input())
if "R" not in list(set(list(s))):
  print(0)
else:
  if s[1]=="S":
    print(1)
  else:
    if s[0]=="S" or s[2]=="S":
      print("2")
    else:
      print("3")

Submission status: Wrong Answer

Solution code:
# coding:utf-8
s = input()
count = 0
ans = 0

if s == 'SSS':
    print(0)
elif s == 'SRR':
    print(2)
elif s == 'SSR':
    print(1)
else:
    for i in range(3):
        if s[i] == 'R':
            count += 1
        elif s[i] == 'S':
            ans = count
            count = 0
    print(ans)

Submission status: Wrong Answer

Solution code:
s=str(input())
ans=0
if s not in "R":
    ans=0
else:
    if s[1]=="S":
        ans=1
    elif s[0]=="R" and s[2]=="R":
        ans=3
    else:
        ans=2

print(ans)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
s=input()
count=0
for i in range(len(s)):
  if s[i]=="R":
    count+=1
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    S = list(input())
    ans = 0
    mae = False
    if S[0] == "R":
        mae =True
    for i in range(len(S)):
        if S[i] == "R":
            if mae:
                ans += 1
                mae = True
        else:
            mae = False
        


    return ans

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

Solution code:
S = input()
if S == 'RSR':
    renzoku = 2
else:
    renzoku = 0
    for si in S:
        if si == 'R':
            renzoku += 1

print(renzoku)

Submission status: Wrong Answer

Solution code:
temp = str(input())
count = 0
 
for i in temp:
  if i == 'R':
    count = count + 1
    max_count = count
  else:
    max_count = count
    count = 0
    
print(max_count)

Submission status: Wrong Answer

Solution code:
print(input().count('R'))

Submission status: Wrong Answer

Solution code:
S = input()

count_r = 0
count_s = 0
tmp = 0
for i,s in enumerate(S):
  if(s == "R"):
    count_r +=1
  if(s=="S"):
    count_s += 1
    tmp = count_r
    
print(tmp)

Submission status: Wrong Answer

Solution code:
s = list(input())
opt = 0
if (s[0] == 'R'):
    opt += 1
if (s[1] == 'R'):
    opt += 1
if (s[2] == 'R'):
    opt += 1
print(opt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()
if S[1] == "S":
    print(1)
else:
    print(S.count('R'))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
temp = input()
print(temp.count('R'))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def RainySeason():
    
    str1 = str(input())

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

if __name__ == '__main__':
    RainySeason()

Submission status: Wrong Answer

Solution code:
n = input()
c = 0
f = False

if n[0] == "R" and n[1]=="R":
  c=2
  f = True
if n[1] == "R" and n[0] == "R":
  c=2
  f = True

if n[1] == "R" and n[0] == "R" and n[2] == "R":
  c= 3
if f == False:
  if n.count("R") == 0:
    c = 0
  else:
    c = 1

print(c)

Submission status: Wrong Answer

Solution code:
S = str(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

cnt = 0
if S[0] == 'R':
    cnt += 1
    if S[1] == 'R':
        cnt += 1
        if S[2] == 'R':
            cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
stri = input()
check = stri[0]
result = []
count = 0
if "R" not in stri:
  print(0)
else:
  for el in stri:
      if el == check:
          count+=1
      else:
          check = el
          if count>1:
              result.append(count)
          count = 1
  result.append(count)
  print(max(result))

Submission status: Wrong Answer

Solution code:
S = [s for s in input()]

S0 = S[0]
S1 = S[1]
S2 = S[2]

if S0 == S1 == 'R' or S1 == S2 == 'R':
    count = 2

elif S0 == S1 == S2 == 'R':
    count = 3

elif S0 == S1 == S2 == 'S':
    count = 0

else:
    count = 1

print(count)

Submission status: Wrong Answer

Solution code:
s= input()
k='S'
count=0
for i in s:
  if k=='R' and i=='R':
    count+=1
    k='R'
  elif k=='S' and i=='R':
    count=1
    k='R'
print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    s = input()
    c = 0
    if s[0] == s[1] == "R" or s[1] == s[2] == "R":
        print(2)
        return

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

main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

def main():
    string = input()
    count = 0
    maxv = -1
    for s in string:
        if s == "R":
            count = count + 1
        else:
            maxv = max(count, maxv)
            count = 0
    print(maxv)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

if s == "rrr":
    print(3)
elif s == "rrs" or "srr":
    print(2)
elif s == "rss" or "rsr" or "ssr":
    print(1)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
s = input()

Rnum=s.count('R')
ans=0
if Rnum==3:
    ans=3
elif Rnum==0:
    ans=0
elif Rnum==2 and s!='RSR':
    ans=2
elif Rnum==1:
    ans=1

print(ans)

Submission status: Wrong Answer

Solution code:
w = list(input().split())

if w == ["RSR"]:
    print(1)

else:
    print(w.count("R"))

Submission status: Wrong Answer

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') or (s[2]=='R' and s[1]=='R') or (s[0]=='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: Wrong Answer

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

print(max_count)

Submission status: Wrong Answer

Solution code:
S = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
    else:
        ans = count
        count = 0
print(ans) if count < ans else print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
a = str(input())
b = list(a)
c = 0
for i in b:
  if i == "R":
    c += 1
print(c)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 15 17:00:46 2020

@author: saito
"""

# %% import phase

# %% define phase
# %% input phase
s = input()

# %% process phase
if s.count('R') == 0 or s.count('R') == 1:
    ans = s.count('R')
elif s.count('R') == 2 and s[1] == 'S':
    ans = 1
else:
    ans = 2    

# %%output phase
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
z=[]
a=input()
for i in a:
    z.append(i)
if z[0]=='R':
    if z[1]=='R':
        print(2)
elif z[1]=='R':
    if z[2]=='R':
        print(2)
elif z[0]=='S':
    if z[1]=='S':
        if z[2]=='S':
            print(0)
else: 
    print(1)

Submission status: Wrong Answer

Solution code:

X = input()

count = 0
max_count = 0
for i in X:
  if i == "R":
    count += 1
  else:
    max_count = count
    count = 0
if count == 3:
  max_count = count
  
print(max_count)

Submission status: Wrong Answer

Solution code:
s=input()
ans=1
if s[0]=="R" and s[1]=="R":
  ans=2

if s[1]=="R" and s[2]=="R":
  ans=2

if s[0]=="R" and s[1]=="R" and s[2]=="R":
  ans=3

print(ans)

Submission status: Wrong Answer

Solution code:
S = list(input())

cnt = 0

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

if S[1]=="R":
    cnt += 1
    if S[2]=="R":
        cnt += 1
    
print (cnt)

Submission status: Wrong Answer

Solution code:
S = str(input())

count = 0
if S[0] == 'R':
    count += 1
    if S[0] == S[1]:
        count += 1
        if S[1] == S[2]:
            count += 1
elif S[1] == 'R':
    if S[1] == S[2]:
        count += 1
elif S[2] == 'R':
    count += 1

print(count)

Submission status: Wrong Answer

Solution code:

import re
S = input()
mmm = re.findall("RRR", S)
mm = re.findall("RR", S)
m = re.findall("R", S)
if mmm:
    print(3)
elif mm:
    print(2)
else:
    print(1)

Submission status: Wrong Answer

Solution code:
a = input()
b = 0
c = 'R'
for i in a:
  if i == 'R' and c == 'R':
    b = b + 1
  elif i == 'S':
    c == 'R'
  else:
    c == 'S'
print(b)

Submission status: Wrong Answer

Solution code:
S = input()
count = 0

for i in range(0, 3):
    if S[i] == 'R':
        count += 1


if S[1] == 'S' and count > 0:
    count -= 1

print(str(count))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

S = str(input())
if(S == "SSS"):
    print(0)
elif(S == "RRR"):
    print(3)
elif(S == "SSR" or S == "SRS" or S == "RSS"):
    print(1)
else:
    print(2)

Submission status: Wrong Answer

Solution code:
S = 'RRS'
p = 0
for i in range(len(S)):
    if S[i] != 'S':
        p =+ 1
print(p)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()
count = 0
for i in range(len(s)):
  if s[i]=='R':
    count += 1
  elif s[i]!='R' and i!=2 :
    count = 0
print(count)

Submission status: Wrong Answer

Solution code:
S = input()
T = "R" + S
cnt = 0
for i in range(1,4):
    if T[i] == "R" and T[i-1] == "R":
        cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
s=input()
a=s[0]
b=s[1]
c=s[2]
if a==b==c:
  print(0)
elif a==b or b==c:
  print(2)
else:
  print(1)

Submission status: Wrong Answer

Solution code:
def function(X):
    if X[1] == 'S':
        if (X[0] == 'R') or (X[2] == 'R'):
            return 1
        else:
            return 0
    else:
        if (X[0] == 'R') and (X[2] == 'R'):
            return 3
        elif (X[0] == 'R') or (X[2] == 'R'):
            return 2
        else:
            return 0


if __name__ == '__main__':
    X = input()
    print(function(X))

Submission status: Wrong Answer

Solution code:
w = list(input().split())

if w == ["rsr"]:
    print(1)

else:
    print(w.count("r"))

Submission status: Wrong Answer

Solution code:
R = input()

rain_count = 0

for i in range(len(R)):
  if R[i] == "R":
    rain_count += 1
  else:
    break
print(rain_count)

Submission status: Wrong Answer

Solution code:
s=input()
arr=[]
for i in s:
    arr.append(i)
brr=[]
count=0
for i in arr:
    if(i=='S'):
        brr.append(count)
    if(i=='R'):
        count=count+1 
brr.append(count)
print(max(brr))

Submission status: Wrong Answer

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

else:
    if s[1]=="R":
        ans=1
        if s[2]=="R":
            ans=2



print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
S = input()

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

Submission status: Wrong Answer

Solution code:
S = input('>>>')
num = 0
num_rev = 0
for i in range(3):
    if S[i] == 'R':
        num += 1
    elif S[i] == 'S':
        num_rev = num
        num = 0
        

print(max(num,num_rev))

Submission status: Wrong Answer

Solution code:
S = input('').split()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = input()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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()
con=0
if s[0] =='R' and s[1]=='R' and s[2]=='R':
    out(3)
elif s[0] =='R' and s[1]=='R':
    out(2)
elif s[1]=='R' and s[2]=='R':
    out(2)
else:
    out(0)

Submission status: Wrong Answer

Solution code:
Word = input()

counter=0

for i in range(len(Word)):
    if 'R'==Word[i]:
        counter +=1
    else:
        counter=0
print(counter)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    S = input()
    S = list(S)

    count = 0
    maxc = 0
    for i in S:
        if i == 'R':
            count += 1
            maxc = count
        else:
            maxc = count
            count = 0

    print(maxc)

Submission status: Wrong Answer

Solution code:
s=input()
ans=0
b='R'
for a in s:
    if a=='R' and b=='R':
        ans+=1
    b=a
print(ans)

Submission status: Wrong Answer

Solution code:
S = str(input())

count = 0
if S[0] == 'R':
    count += 1
    if S[0] == S[1]:
        count += 1
        if S[1] == S[2]:
            count += 1
elif S[1] == 'R':
    if S[1] == S[2]:
        count += 1

print(count)

Submission status: Wrong Answer

Solution code:
s=input()
xs=[x for x in s if x == "R"]

print(len(xs))

Submission status: Wrong Answer

Solution code:
a = list(input())
count=0
if a.count('R')==3:
  print(3)
elif a.count('R')==1:
  print(1)
else:
  flag = True
  for i in range(1,3):
    if a[i]=='R':
      if a[i-1]=='R':
        print(2)
        flag =False
        break
  if flag==True:
    print(1)

Submission status: Wrong Answer

Solution code:
renzoku = 0

S = input()

for i, weather in enumerate(S):
    if not weather == "R":
        continue
    if i == 0: renzoku += 1
    try:
        if S[i+1] == "R":
            renzoku += 1
    except:
        continue

print(renzoku)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    S = input()
    if S[0] == "S":
        return "0"
    elif S[1] == "S":
        return "1"
    elif S[2] == "S":
        return "2"
    else:
        return "3"

if __name__ == '__main__':
    print(main())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

if __name__ == '__main__':
	S = sys.stdin.readline().rstrip()
	if S == 'SSS':
		print('3')
	elif 'SS' in S:
		print('2')
	elif 'S' in S:
		print('1')
	else:
		print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
string=input()

r=0
for i in range(len(string)):
  if string[i]=='R':
    r+=1
print(r)

Submission status: Wrong Answer

Solution code:
from collections import Counter
import copy
from itertools import combinations


def A(s):
  l = 0
  max_l = 0
  for i in range(len(s)):
    if i == 0 and s[i] == 'R':
      l += 1
    elif s[i - 1] == s[i] and s[i] == 'R':
      l += 1
    else:
      l = 0
    if l > max_l:
      max_l = l
  return max_l


def B():
  pass


def C():
  pass


def main():
  s = input()
  print(A(s))


if __name__ == '__main__':
  main()