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:
#!/usr/bin/env python3
import collections as cl
import sys


def II():
    return int(sys.stdin.readline())


def MI():
    return map(int, sys.stdin.readline().split())


def LI():
    return list(map(int, sys.stdin.readline().split()))


def main():
    S = input()

    ans = 0

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

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

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

    print(ans + 1)


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()

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

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

count = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

count = 0
max_count = 0
for i in s:
  if i == '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:
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:
input_str = input()

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

Submission status: Accepted

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

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
S = input()
ren = 0

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()
ws = [S[0],S[1],S[2]]
max_count = 0
count = 0
for w in ws:
    if w == "R":
        count += 1
        max_count = max(count, max_count)
    else:
        count = 0
print(max_count)

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

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

ans = max(tmp,ans)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
Sum = 0
Max = 0
for i in range(3):
    if S[i] == 'R':
        Sum += 1
        if Max < Sum:
            Max = Sum
    else:
        Sum = 0
print(Max)

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

Submission status: Accepted

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


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

Submission status: Accepted

Solution code:
from sys import stdin
def ip(): return [int(i) for i in stdin.readline().split()]
def sp(): return [str(i) for i in stdin.readline().split()]



A = str(input())
ans = 0
curr = 0
for i in A:
    if i == 'R':
        curr += 1
        ans = max(ans, curr)
    else:
        curr = 0
print(ans)

Submission status: Accepted

Solution code:
s=input()

r=s.count('R')

ans=0

if r==1:
    ans=1
elif s[1]=='R' and r==2:
    ans=2

elif s[1]=='S' and r==2:
    ans=1
elif r==3:
    ans=3

print(ans)

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

Submission status: Accepted

Solution code:
import sys,collections,math,random,fractions,bisect;sys.setrecursionlimit(10**7)
sr = sys.stdin.readline; P = print; P2 = lambda x: print(*x, sep="\n")
def I(i=0): t = [int(x)-i for x in sr().split()];return t
def S(): t = sr().split(); return t if len(t) > 1 else t[0]
L1,L2,L3,L4, = [],[],[],[]
 
s = S()
if "RRR" in s:
    print(3)
elif "RR" in s:
    print(2)
elif "R" in s:
    print(1)
else:
    print(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# count number of R
# if R is 2, then check if S is in the middle

s = input()
ans = 0
for i in s:
    if i == "R":
        ans += 1
if ans != 2:
    print(ans)
else:
    if s[1] == 'S':
        print(1)
    else:
        print(2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from sys import stdin
input = stdin.readline()
counter = 0
max_c = 0
for i in input:
    if i == 'R':
        counter += 1
    else:
        if max_c < counter:
            max_c = counter
        counter = 0
if max_c < counter:
    max_c = counter
print(max_c)

Submission status: Accepted

Solution code:
S = list(input())
ans = 0
tmp = 0

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

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 == 'RSS':
    print('1')
elif s == 'SRR':
    print('2')
elif s == 'RSR':
    print('1')
elif s == 'RRS':
    print('2')
elif s == 'RRR':
    print('3')

Submission status: Accepted

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

    ans = 0
    tmp = 0
    for s in S:
        if s == 'R':
            tmp += 1
        else:
            if ans < tmp:
                ans = tmp
            tmp = 0

    if ans < tmp:
        ans = tmp

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
sum = S.count('R')
if sum == 2 and S[1] == 'S':
    sum -= 1
print(sum)

Submission status: Accepted

Solution code:
s = input()

res = 0

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

res = max(res,rainy)

print(res)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
S = input()

count = 0
max_count = 0
for s in S:
    if s == 'R':
        count += 1
    else:
        count = 0
    
    if max_count < count:
        max_count= count

print(max_count)

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()
count = 0
for i in s:
    if i == 'R':
        count += 1
if s[1] == 'S' and count == 2:
    print(1)
else:
    print(count)

Submission status: Accepted

Solution code:
s = input()

if s[0] == 'R' and s[1] == 'R' and s[2] == 'R':
    print(3)
elif (s[0] == 'R' and s[1] == 'R') or (s[1] == 'R' and s[2] == 'R'):
    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 == "RRR":
    print(3)
    
elif s == "SSR" or s == "SRS" or s == "RSS" or s == "RSR":
    print(1)
    
else:
    print(2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
k = input()
ans = 0 
fin = 0
for i in k:
  if i == 'R':
    ans+=1;
  else:
    fin = max(ans,fin)
    ans = 0  
print(max(fin,ans))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Date [ 2020-08-15 21:00:28 ]
# Problem [ a.py ]
# Author Koki_tkg

import sys;      from decimal import Decimal
import math;     from itertools import combinations, product
import bisect;   from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 6 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def lcm(a: int, b: int) -> int: return (a * b) // math.gcd(a, b)

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

if __name__ ==  '__main__':
    Main()

Submission status: Accepted

Solution code:
#n = int(input())
#a, b = map(int,input().split())
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
s=input()
ans=0
l1=['SRR','RRS']
if s.count('R')==0:
    ans=0
elif s.count('R')==1:
    ans=1
elif s.count('R')==3:
    ans=3
else:
    if s in l1:
        ans=2
    else:
        ans=1
print(ans)

Submission status: Accepted

Solution code:
cli =  str(input())
counter = cli.count("R")
if counter <= 1:
    print(counter)
elif counter == 3:
    print(counter)
else:
    if cli == "RSR":
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
a = list(str(input()))
count = 0
ans = 0
for i in range(3):
    if a[i] == "R":
        count += 1
    else:
        ans = max(ans, count)
        count = 0
ans = max(ans, count)

print(ans)

Submission status: Accepted

Solution code:
S = list(input())

max_result = 0
current = 0

for s in S:
    if s == "R":
        current+=1
    else:
        current=0

    if current>max_result:
        max_result=current
print(max_result)

Submission status: Accepted

Solution code:
s = input()

if s[1] == 'S' and s.count('R') != 0:
  print(1)
  
elif s[1] == 'S' and s.count('R') == 0:
  print(0)

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

Submission status: Accepted

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


def main():
    s=input()
    c = s.count("R")
    
    if c == 2 and s[1] == "S":
        c += -1
    print(c)


    
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
S = input()

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

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

Submission status: Accepted

Solution code:
s = input()
start = 0
ans = 0
for j in range(len(s)):
    if s[j] != 'R':
        ans = max(j - start, ans)
        start = j + 1


ans = max(len(s) - start, ans)
print(ans)

Submission status: Accepted

Solution code:
S = input()
cnt = S.count('R')
if cnt != 2:
    print(cnt)
else:
    if S == 'RSR':
        print(1)
    else:
        print(2)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    S = input()

    ans = 0
    # for i in range(len(S)):
    if S[0]==S[1]==S[2]=='R':
        print(3)
    elif S[0]==S[1]=='R':
        print(2)
    elif S[1]==S[2]=='R':
        print(2)
    elif 'R' in S:
        print(1)
    else:
        print(0)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
s = str(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()
Rc = 0
for i in range(len(S)):
    if S[i] == 'R':
        Rc += 1
if Rc == 2:
    if S[1] == 'S':
        print(1)
    else:
        print(2)
else:
    print(Rc)

Submission status: Accepted

Solution code:
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)

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

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[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)
else:
    if "R" in s:
        print(1)
    else:
        print(0)

Submission status: Accepted

Solution code:
s = list(input())
ans = 0
c = 0
for i in s:
    if i == "R":
        c += 1
        ans = c
    else:
        if ans < c:
            ans = c
        c = 0
print(ans)

Submission status: Accepted

Solution code:
S = list(input())

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

Submission status: Accepted

Solution code:
import sys
k = list(input())

r_number = k.count('R')
if r_number == 2:
    if k[1] == 'R':
        print(2)
    else:
        print(1)
else:
    print(r_number)

Submission status: Accepted

Solution code:
S =  input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
ans = 0
flag = True
for s in S:
    if flag and s == 'R':
        ans += 1
    if s == 'R':
        ans = max(1, ans)
        flag = True
    else:
        flag = False
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=='RSS':
    print(1)
if S=='SRR':
    print(2)
if S=='SRS':
    print(1)
if S=='SSR':
    print(1)
if S=='SSS':
    print(0)

Submission status: Accepted

Solution code:
s = input()
n = s.count('R')

if n == 2:
    if s[1] == 'R':
        print(2)
    else:
        print(1)
else:
    print(n)

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
def main():
    # = int(input())
    # = map(int, input().split())
    # 
    # for i in range():
    #     .append(list(map(int, input().split())))
    s = input()
    all_max = 0
    max = 0
    for i in range(len(s)):
        if s[i] == 'R':
            max += 1
        else:
            if max > all_max:
                all_max = max
            max = 0
    if max > all_max:
        all_max = max
    print(all_max)
            
if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

cnt = 0

for i in range(len(S)):
    if S[i] == "R":
        cnt += 1

if cnt >= 2 and S[1] == "S":
    cnt = 1

print(cnt)

Submission status: Accepted

Solution code:
##A
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:
S = input().rstrip()
if S[1] == 'S':
    print(min(1,S.count('R')))
else:
    print(S.count('R'))

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

s = input()

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
nr = s.count('R')
if nr != 2:
    print(nr)
else:
    if s in ['RRS', 'SRR']:
        print(2)
    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("R")==2:
    if (s[0]=="R" and s[1]=="R") or (s[1]=="R" and s[2]=="R"):
        print(2)
    else:
        print(1)
else:
    print(0)

Submission status: Accepted

Solution code:
ss = input().split('S')
m = 0
for li in ss:
  m = max(m,len(li))
  
print(m)

Submission status: Accepted

Solution code:

s = input()

ans = 0

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s =input()

#print(s)

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

Submission status: Accepted

Solution code:
s=input()
if s.count('R')<2 or s.count('R')==3:
  print(s.count('R'))
  exit()
if 'RR' in s:
  print(2)
else:
  print(1)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
count = 0
result = 0
for i in range(3):
  if S[i] == 'R':
    count += 1
    if result < count:
      result = count
  else:
    count = 0
print(result)

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)
elif s == "RRR":
    print(3)

Submission status: Accepted

Solution code:
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
s = input()
cnt = 0
ans = 0
if s=="RRR":
    ans = 3
elif s=="SSS":
    ans=0
elif s=="RRS" or s=="SRR":
    ans =2
else:
    ans = 1
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
#b = int(input())
#n, m = [int(i) for i in input().split()]
#table = [[int(i) for i in input().split()] for j in range(n)]

s = input()

count = 0
for i in range(3):
    if(s[i] == "R"):
        count = 1

for i in range(2):
    if(s[i] == "R" and s[i+1] == "R"):
        count = 2

if(s[0] == "R" and s[1] == "R" and s[i+1] == "R"):
    count = 3

print(count)

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

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

ans = max(ans, count)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S=input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

#https://atcoder.jp/contests/agc008/submissions/15248942
sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))

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)
elif S == 'RRR':
    print(3)

Submission status: Accepted

Solution code:
s = input()
a = "SSS"
b = "RRR"
c = ["SRR", "RRS"]
if s == a:
    x = 0
elif s == b:
    x = 3
elif s in c:
    x = 2
else:
    x = 1
print(x)

Submission status: Accepted

Solution code:
S = input()
ans = 0
tmp = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

print(c_max)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

sn = s.strip('S')

if 'S' in sn:
  print(1)
else:
  print(len(sn))

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)
else:
    print(3)

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 -*-
"""
@author: H_Hoshigi
"""
def main():
    S = input()

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

if __name__ == "__main__":
    main()