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 .

Solution (Python):
import sys
import copy
input = sys.stdin.readline

S=(input())

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

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

Solution (Python):
S = input()
res = 0
streak = 0
rs = ""
for s in S:
  if s == 'R':  
    if rs == s:
      res += 1
    else:
      streak = 1
  else:
    streak = 0
  res = max(res, streak)
  rs = s
  
print(res)

Solution (Python):
input = raw_input

s = input()

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

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
import sys

S = input()

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

print(ans)

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

Solution (Python):
S = input()

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

print(result)

Solution (Python):
def main():
    N = str(input())
    

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

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
S = input()

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

Solution (Python):
s = input()
s = list(s)

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

Solution (Python):
S = input()

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

Solution (Python):
S = input()

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

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

Solution (Python):
S = input()

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

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

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

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

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

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

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

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

Solution (Python):
s=list(input())
if s[0]=="R":
  if s[1]=="R":
    if s[2]=="R":
      print(3)
    else:
      print(2)
  else:
    print(1)
else:
  if s[1]=="R":
    if s[2]=="R":
      print(2)
    else:
      print(1)
  else:
    if s[2]=="R":
      print(1)
    else:
      print(0)

Solution (Python):

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
S = input()

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

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

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

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
s = input()

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

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):



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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
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()

Solution (Python):
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))

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

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

Solution (Python):
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)

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

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
S = input()

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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))

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

Solution (Python):
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)

Solution (Python):




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


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

Solution (Python):




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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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'))

Solution (Python):
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()

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):
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)

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

def main():
    S = input()

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

Solution (Python):
s = str(input())

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

Solution (Python):
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)

Solution (Python):
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()

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

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

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

Solution (Python):
S = input()

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

Solution (Python):
def main():
    
    
    
    
    
    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()

Solution (Python):
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)

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

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):

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)

Solution (Python):
S = input().rstrip()
if S[1] == 'S':
    print(min(1,S.count('R')))
else:
    print(S.count('R'))

Solution (Python):








s = input()

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

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):
s = input()
nr = s.count('R')
if nr != 2:
    print(nr)
else:
    if s in ['RRS', 'SRR']:
        print(2)
    else:
        print(1)

Solution (Python):
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)

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

Solution (Python):

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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
s =input()



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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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)

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

Solution (Python):




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)

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

Solution (Python):
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)

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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
import sys
import math


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)

Solution (Python):
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)

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

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

Solution (Python):
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)

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