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
input = sys.stdin.readline
def main():
    S = input().rstrip()
    CNT = 0
    ans = 0
    for c in S:
        if c == 'R':
            CNT += 1
        else:
            ans = max(ans,CNT)
            CNT = 0

    ans = max(ans,CNT)
    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):

S = input()
ans = 0
for i in range(3):
    if S[i]=='R':
        ans += 1
if S=='RSR':
    ans = 1
print(ans)

Solution (Python):

s=input()
k=s.count('R')
m=s.count('RR')
n=s.count('RRR')
if n!=0:
  print(3)
elif m!=0:
  print(2)
elif k!=0:
  print(1)
else:
  print(0)

Solution (Python):
S=list(input())
W=(S.count('R'))
if S[1]=='R':
  print(W)
else:
  if W==1 or W==0:
    print(W)
  else:
    print(W-1)

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

Solution (Python):
S = input()
if S == "RRR":
    print(3)
elif S == "RRS" or S == "SRR":
    print(2)
else:
    if "R" in S:
        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:
    if S[1]=='S':
        cnt=1

print(cnt)

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

Solution (Python):
s = input()

ans = 0

if s == "SSS":
    ans = 0
elif s == "SSR":
    ans = 1
elif s == "SRS":
    ans = 1
elif s == "SRR":
    ans = 2
elif s == "RSS":
    ans = 1
elif s == "RSR":
    ans = 1
elif s == "RRS":
    ans = 2
elif s == "RRR":
    ans = 3

print(ans)

Solution (Python):
S = list(input())
cnt = 0
if S[0] == 'R':
    if S[1] == 'R':
        if S[2] == 'R':
            cnt = 3
        else:
            cnt = 2
    else:
        cnt = 1
else:
    if S[1] == 'R':
        if S[2] == 'R':
            cnt = 2
        else:
            cnt = 1
    else:
        if S[2] == 'R':
            cnt = 1
        else:
            cnt = 0
print(cnt)

Solution (Python):
s=str(input())
count=0
res=0
for i in range(3):
    if s[i]=="R":
        count+=1
        res=count
    else:
        count=0

print(res)

Solution (Python):
mozi = input()
if mozi == 'RRR':
    print(3)
elif mozi == 'RRS':
    print(2)
elif mozi == 'SRR':
    print(2)
elif mozi == 'SRS':
    print(1)
elif mozi == 'SSR':
    print(1)
elif mozi == 'RSS':
    print(1)
elif mozi == 'RSR':
    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):
str1=input()
ct=0
for i in range(0,3):
    if(str1[i]=='S'):
        ct+=1
if(ct==0):
    print(3)
if(ct==3):
    print(0)
if(ct==2):
    print(1)
if(ct==1):
    if(str1[1]=='S'):
        print(1)
    else:
        print(2)

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

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

Solution (Python):

input_s = input();

output = 0;

if "R" in input_s:
    output = 1;

if "RR" in input_s:
    output = 2;

if "RRR" in input_s:
    output = 3;

print(output);

Solution (Python):
S=input()

if S.count("R")==2:
    if S.count("RR")==1:
        print(2)
    else:
        print(1)
    
else:
    print(S.count("R"))

Solution (Python):
s = input()
rain_max = 0
local_max = 0
for i in range(len(s)):
    if s[i] == 'R':
        local_max += 1
    else:
        if local_max > rain_max:
            rain_max = local_max
        local_max = 0
if local_max > rain_max:
    rain_max = local_max
print(rain_max)

Solution (Python):
a = list(input())
x = 3
ans = 0
if 'R' in a:
    x = a.index('R')
for i in range(x, 3):
    if a[i] == 'R':
        ans += 1
    else:
        break
print(ans)

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

Solution (Python):
def main():
    s = input()
    if s == 'SSS':
        print(0)
    elif s == 'SRR':
        print(2)
    elif s == 'SSR':
        print(1)
    elif s == 'SRS':
        print(1)
    elif s == 'RSS':
        print(1)
    elif s == 'RSR':
        print(1)
    elif s == 'RRS':
        print(2)
    elif s == 'RRR':
        print(3)
        
if __name__ == '__main__':
    main()

Solution (Python):
string=input()

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

Solution (Python):
s = input()
if(s=='RRR'):
  ans = 3
elif(s[0:2]=='RR' or s[1:3]=='RR'):
  ans = 2
elif(s[0]=='R' or s[1]=='R' or s[2]=='R'):
  ans = 1
else:
  ans = 0

print(ans)

Solution (Python):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = read().rstrip().decode()

def solve(x):
    if x.count('RRR'):
        return 3
    if x.count('RR'):
        return 2
    if x.count('R'):
        return 1
    return 0

print(solve(x))

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

n = len(s)
c = 0

for i in range(n):
    if s[i] == "R":
        j = i
        a = 0
        while s[j] == "R" and j < n-1:
            a += 1
            j += 1
        if j == n-1 and s[j] == "R":
            a += 1
        c = max(a,c)

print(c)

Solution (Python):
tenki = list(input())
ans = 0
max_ans = 0
for i in tenki:
  if i == "R":
    ans = ans + 1
    flag = 0
  else:
    flag = 1
  if flag == 1:
    if max_ans < ans:
      max_ans = ans
    ans = 0
if max_ans > ans:
  print(max_ans)
else:
  print(ans)

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)
c=0
max=0
for i in S:
    if i=="R":
        c+=1
    else:
        if max<c:
            max=c
            c=0

if max<c:
    max=c
    c=0

print(max)

Solution (Python):
w=input()
count=0

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

Solution (Python):

a=input().split("S")
cnt=0
for i in a:
  cnt=max(cnt, len(i))
print(cnt)

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

    if candidate > best:
        best = candidate

    return best

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

    print(main(_S))

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

Solution (Python):

import io, sys

def main():
    S = sys.stdin.readline().rstrip()
    
    prev = ""
    cnt = 0
    cnt_max = 0

    for char in S:
        if char == "R":
            cnt += 1
        elif char == "S":
            cnt = 0
        
        cnt_max = max(cnt_max, cnt)
    
    print(cnt_max)


if __name__ == "__main__":
    main()

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

Solution (Python):
S = input()
n = S.count("R")
if S[1] == "R":
  print(n)
elif n >= 1:
  print(1)
else:
  print(n)

Solution (Python):
S = input()

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

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

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

print(count)

Solution (Python):

A = input()
total = 0
for i in range(3):
    if A[0] == "R" and A[1] == "R" and A[2] == "R":
        total = 3
    elif A[0] == "R" and A[1] == "R" and A[2] == "S":
        total = 2
    elif A[0] == "R" and A[1] == "S" and A[2] == "R":
        total = 1
    elif A[0] == "S" and A[1] == "R" and A[2] == "R":
        total = 2
    elif A[0] == "S" and A[1] == "S" and A[2] == "R":
        total = 1
    elif A[0] == "S" and A[1] == "R" and A[2] == "S":
        total = 1
    elif A[0] == "R" and A[1] == "S" and A[2] == "S":
        total = 1
    elif A[0] == "S" and A[1] == "S" and A[2] == "S":
        total = 0

print(total)

Solution (Python):
S = list(input())
r = 0
pre = 0
for x in S:
    if x == 'R':
        pre += 1
        r = max(pre, r)
    else:
        pre = 0
print(r)

Solution (Python):
s = input()
cnt = 0
cnt_t = 0
for i in range(3):
    if s[i] == "R":
        cnt_t += 1
        if cnt < cnt_t:
            cnt = cnt_t
    else:
        cnt_t = 0
print(cnt)

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

r3=s.count('RRR')
if r3==1:
    print(3)
    exit(0)
r2=s.count('RR')

if r2==1:
    print(2)
    exit(0)

r=s.count('R')

if r>=1:
    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):
from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

def main():
    s = rs()
    ans = 3 if "RRR" in s else 2 if "RR" in s else 1 if "R" in s else 0
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
s=input()

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

Solution (Python):
s = input()

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

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





print(cnt)

Solution (Python):
w = input()

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

Solution (Python):
s = input()
num = 0
num2 = 0
for i in range (3) :


  yesterday = 'R'
  if s[i] == 'R':
    if yesterday == 'R':
      num2 += 1
    else :
      yesterday = 'R'
  else :
    yesterday = 'S'
    if num2 > num:
      num = num2
      num2 = 0


if num2 > num:
  num = num2


print(num)

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

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

Solution (Python):
S = input()

flag = 0
max_ = 0
for i in S:  
    if i == "R":
        flag += 1
    else:
        flag = 0
    if flag > max_:
        max_  = flag

print(max_)

Solution (Python):
T = input()
ans = 0
cur = 0
for i in T:
    if i=="R":
        cur += 1
    else:
        cur = 0
    ans = max(ans,cur)
print(ans)

Solution (Python):
data = list(input())
count = 0
for i in data:
  if(i=='R'):
    count+=1
    
if (count ==2 and data[1]=='S'):
	count =1
    
print(count)

Solution (Python):
S = input()

ans = 0
if S == "SSS":
    ans = 0
elif S in ["RSS", "SRS", "SSR", "RSR"]:
    ans = 1
elif S in ["RRS", "SRR"]:
    ans = 2
elif S == "RRR":
    ans = 3

print(ans)

Solution (Python):
weather = input()

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

Solution (Python):
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)
elif N[0] == 'R' or N[1] == 'R' or N[2] == 'R':
    print(1)
else:
    print(0)

Solution (Python):
tenki = input()

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

Solution (Python):
S=input()
bef = S[0]
result = 0
result_lst=[]
if bef == "R":
    result = 1


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

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

Solution (Python):
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 = list(input())
count = 0
ans = 0
for w in S:
    if w == 'R':
        count += 1
        
    else:
        count = 0
    if count > ans:
        ans = count
print(ans)

Solution (Python):


S = input()


ans = S.count("R") - (S == "RSR")


print(ans)

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

n = s.count('R')

if n == 0:
    print(0)
else:
    if n == 1:
        print(1)
    else:
        m = s.count('RR')
        if m == 0:
            print(1)
        elif m == 1:
            l = s.count('RRR')
            if l == 1:
                print(3)
            else:
                print(2)

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

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

"""
Created on Sat Aug 15 17:00:46 2020

@author: saito
"""





s = input()


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


print(ans)

Solution (Python):


if __name__ == "__main__":
  s = list(input())
  sum = 0
  for i in range(3):
    if s[i] == 'R':
      sum = 1
  if s[0] == 'R' and s[1] =='R':
    sum += 1
  if s[1] == 'R' and s[2] == 'R':
    sum += 1
  print(sum)

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

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

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

    print(count)


if __name__ == '__main__':
    main()

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

Solution (Python):


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    S=input()
    
    if "RRR" in S:
        print(3)
    elif "RR" in S:
        print(2)
    elif "R" in S:
        print(1)
    else:
        print(0)

main()

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

Solution (Python):
s=input()

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

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 == "RRS" or S == "SRR":
    print(2)
elif S == "RRR":
    print(3)

Solution (Python):
s = input()
max = 0
cnt = 0
for i in range(3):
    if s[i] == "R":
        cnt += 1
if s[1] == "S" and cnt >= 2:
    cnt = 1
print(cnt)

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


if __name__ == "__main__":
    main()

Solution (Python):
S=input()
cnt=0

if S=="RSR":
    cnt+=1
else:
    for c in S:
        if c=='R':cnt+=1
    
print(cnt)

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

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

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

Solution (Python):
from sys import stdin

S = stdin.readline().rstrip()

count = 0
if S[0]=='R':
  if S[1] =='R':
    if S[2] =='R':
      count = 3
    else:
      count = 2
  else:
    if S[2] =='R':
      count = 1
    else:
      count = 1
else:
  if S[1] =='R':
    if S[2] =='R':
      count = 2
    else:
      count = 1
  else:
    if S[2] =='R':
      count = 1
    else:
      count = 0

print(count)

Solution (Python):
s = input()

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


print(ans)

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

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

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

Solution (Python):
S = input()

Rs = S.split("S")

count = 0
for r in Rs:
  if len(r) > count:
    count = len(r)
    
print(count)

Solution (Python):


str = input()

if 'RRR' in str:
    print(3)
elif 'RR' in str:
    print(2)
elif 'R' in str:
    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):
x = input()
count = 0
if x[0] == 'S':
    if x[1] == 'R':
        count+= 1
        if x[2] == 'R':
            count += 1
        if x[2] == 'S':
            count = count

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

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

    if x[1] == 'S':
        if x[2] == 'R':
            count = 1
        if x[2] == 'S':
            count = count

print(count)

Solution (Python):
S = input()
counts = []
count = 0
for x in S:
  if x == 'R':
    count += 1
  else:
    counts.append(count)
    count = 0
counts.append(count)
print(max(counts))

Solution (Python):
S = input()

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

Solution (Python):
S = input()

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

if tmp == '111':
    print(3)
elif tmp == '110':
    print(2)
elif tmp == '101':
    print(1)
elif tmp == '011':
    print(2)
elif tmp == '100':
    print(1)
elif tmp == '010':
    print(1)       
elif tmp == '001':
    print(1)
else:
    print(0)

Solution (Python):
s = input()
cnt = 0
R_max = 0
for mozi in s:
    if mozi == "R":
        cnt+= 1
    else:
        R_max = max(cnt,R_max)
        cnt = 0
R_max = max(cnt,R_max)
print(R_max)

Solution (Python):
S = input()

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

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

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

Solution (Python):
s = list(input())
count = 0
flag = False
max = 0
for i in s:
    if i == 'R':
        if flag:
            count += 1
        else:
            count = 1
            flag = True
        if max < count:
            max = count
    else:
        flag = 0
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):
import sys
input = sys.stdin.readline




'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''

cnt=0
s=input().strip("\n")
for i in range(2):
    if s[i]=="R" and cnt==0:
        cnt+=1
    if s[i]==s[i+1]=="R":
        cnt+=1
if s[2]=="R" and cnt==0:
    cnt+=1
print(cnt)

Solution (Python):
S = input()
c =[0 for i in range(3)]
k = 0
for i in range(3):
    if S[i]== 'R' :
        c[k] = c[k] + 1
    elif S[i] == 'S' :
        k = k + 1

ans = max(c)
print(ans)

Solution (Python):
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)
elif ans == 0:
    print(0)
else:
    if S[1] == "S":
        print(1)
    else:
        print(2)

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

print(ans)

Solution (Python):
def A(S):
    answer = 0

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

    return answer

  
S = input()
print(A(S))

Solution (Python):
from collections import Counter
import copy
from itertools import combinations


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

Solution (Python):
s=input()
c=0
for j in range(len(s)):
    if(s[j]=='R'):
        while(j<3 and s[j]=='R'):
            c=c+1
            j=j+1
            
            
        break
print(c)

Solution (Python):
weather = input()
count = 0
count_max = 0
for i in weather:
    if i == 'R':
        count += 1
        if count > count_max:
            count_max = count
    else:
        count = 0
print(count_max)

Solution (Python):
S = input()
sum = 0
tmp = 'R'
for i in S:
    if i == 'R' and sum == 0:
        sum = 1
    elif i=='R' and tmp == 'R':
        sum += 1
    tmp = i
print(sum)

Solution (Python):
S = str(input())
counter = 0
C = []
for i in range(len(S)):
  if S[i] == "R":
    counter += 1
    C.append(counter)
  else:
    counter = 0

if C != []:
  print(max(C))
else:
  print(0)

Solution (Python):
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[2]=="S":
    print(0)
  else:
    print(1)

Solution (Python):
s = input()
ans = 0
cnt = 0

for i in range(len(s)):
    if s[i] == 'R':
        if i > 0 and s[i-1] == 'R':
            cnt += 1
        else:
            cnt = 1
    else:
        cnt = 0
    ans = max(ans, cnt)
print(ans)

Solution (Python):
S = input()
s = [0, 0, 0]
j = 0
for i in range(3):
    if S[i] == "R":
        s[j] += 1
    else:
        j += 1
print(max(s))

Solution (Python):
s = input()
flag = 1
ans = 0
tmp = 0

for i in range(3):
    if s[i] == "R":
        tmp += 1
    else:
        tmp = 0
    ans = max(tmp, ans)

print(ans)

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

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 s=="RRR":
  print(3)
elif s=="RRS" or s=="SRR":
  print(2)
elif s=="SSS":
  print(0)
else:
  print(1)

Solution (Python):
l=input().split("S")
out=0
for i in l:
    if len(i)>out:
        out=len(i)
print(out)

Solution (Python):
S = input()

K = S.count("R")

if K == 0:
    print(0)

elif K == 1:
    print(1)

elif K == 3:
    print(3)

elif K == 2:
    k2 = S.count("RR")
    if k2 == 0:
        print(1)
    else:
        print(2)

Solution (Python):
s = input()
print(s.count('R')-1 if s=='RSR' else s.count('R'))

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):
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter,defaultdict
from operator import mul
import copy


import heapq
sys.setrecursionlimit(10**6)

INF = 10**18
import bisect
import statistics
mod = 10**9+7


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

Solution (Python):
S = input()
counts = [0]
if "R" in S:
  counts.append(1)
if "RR" in S:
  counts.append(2)
if "RRR" in S:
  counts.append(3)
print(max(counts))

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

Solution (Python):
s = input()
if('R' not in s):
    print(0)
else:
    c = s.count('R')
    if(c==2 and s[1]=='S'):
        print(1)
    else:
        print(c)

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

if count==2 and S[1]=='S':
    count=1

print(count)

Solution (Python):
w = input()
we = list(w)
count = 0
m_count = 0

for i in we:
    if i == "R":
        count += 1
    else:
        if count > m_count:
            m_count = count
        count = 0

if count > m_count:
    m_count = count
print(m_count)