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):
s = input()
ans = 0
x = list(s).count("R")

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

Solution (Python):
s = input()

count = 0
bef = ""
maxC = 0
for i in range(len(s)):
    if bef == "" and s[i] == "R":
        count+=1
    else:
        if s[i] == "R" and bef == "R":
            count+=1
        elif s[i] == "R" and bef == "S":
            if count > maxC:
                maxC = count
            count = 1
        elif s[i] == "S" and bef == "R":
            if count > maxC:
                maxC = count
            count = 0
        else:
            count = 0
    bef = s[i]
if count > maxC:
    maxC = count
print(maxC)

Solution (Python):
S = input().strip()

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

Solution (Python):
s=input()
hola=0
mysy=[]
for i in range(len(s)):
    if(s[i]=="R"):
        hola+=1
    else:
        if(hola!=0):
            mysy.append(hola)
            hola=0
    mysy.append(hola)
print(max(mysy))

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

if S.count("RRR") == 1:
  print(3)
elif S.count("RR") == 1:
  print(2)
elif S.count("SSS") == 1:
  print(0)
else:
  print(1)

Solution (Python):
import sys

s = input()

ans = 0

for _s in range(3, 0, -1):
    if _s * "R" in s:
        print(_s)
        sys.exit()

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 == 'RSR':
    print(1)
    exit()
else:
    print(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):
S = input()

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

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

if "RRR" in s:
  count = 3
elif "RR" in s:
  count = 2
elif "R" in s:
  count = 1
else:
  count = 0      

print(count)

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

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

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

print(maxCnt)

Solution (Python):
s = input()

tmp = s.replace('S', '')

if len(tmp) == 2:
  if s == "RSR":
    print(1)
  else:
    print(2)

else:
  print(len(tmp))

Solution (Python):

def main():
    s = str(input())

    max = 0
    count = 0
    for c in s:
        if c == "R":
            count += 1
        else:
            if max < count:
                max = count
                count = 0
    
    if max < count:
        max = count

    print(str(max))

if __name__ == "__main__":
    main()

Solution (Python):
s=input()
count=0
key=0

for i in range(3):
    if key==0:
        if s[i]=='R':
            count=1
            key=1
            continue
    if key==1:
        if s[i]=='R':
            count+=1
        if s[i]=='S':
            break

print(count)

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

Solution (Python):
word = input()

res = 0
count = 0
for s in word:
    if s == 'R':
        count += 1
    else:
        if res < count:
            res = count
        count = 0
if res < count:
    res = count
print(res)

Solution (Python):

weth = input()

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

Solution (Python):
s = input()


if s == 'RSR':
  print(1)
else:
  print(s.count('R'))

Solution (Python):
n = input().split('S')
print(len(sorted(n,key=len, reverse=True)[0]))

Solution (Python):
from sys import stdin,stdout
from collections import defaultdict
import math


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

Solution (Python):

 

 
import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy
 

 










 
S = input()

tmp = 0
ans = 0

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

print(ans)

Solution (Python):
S = input()

print(S.count("R") if S != "RSR" else 1)

Solution (Python):
s=input()
no_r=s.count('R')
if no_r!=2 or s[1]=='R':
    print(no_r)
else:
    print(1)

Solution (Python):

import sys
import numpy as np


def solve(S: str):
    if S=="SSS":
        print(0)
        return
    if S=="SSR" or S=="SRS" or S=="RSS" or S=="RSR":
        print(1)
        return
    if S=="SRR" or S=="RRS":
        print(2)
        return
    else:
        print(3)
        return

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

Solution (Python):

S = input()

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

print (ans)

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

Solution (Python):
S = input()

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

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

tenki = input()

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

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

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

Solution (Python):
S=list(str(input()))
count,maxc= 0,0
for i in range(len(S)):
    if S[i]== "R":
        count += 1
    else:
        if maxc < count:
            maxc = count
        count = 0
if maxc < count:
    maxc = count
print(maxc)

Solution (Python):
s = input()

answer = 0
count = 0
for i in range(len(s)):
  if s[i] == "R":
    count += 1
    if i == len(s)-1 :
      if count > answer :
        answer = count  
  else :
    if count > answer :
      answer = count
    count = 0
  
print(answer)

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

numr = ss.count('R')

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

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

if s.find("RRR") >= 0:
    ans = 3
elif s.find("RR") >= 0:
    ans = 2
elif s.find("R") >= 0:
    ans = 1

print(ans)

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

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

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

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

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







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

  return res



def main():
  s = input()
  print(solve(s))
  return

if __name__ == '__main__':
  main()

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

Solution (Python):
S = input()

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

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

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

Solution (Python):

s = input().split('S')
print(len(max(s)))

Solution (Python):
S = input()

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

Solution (Python):
s=input()
 
ans = 1

for i in range(2):
  if s[i]=="R" and s[i+1]=="R":
    ans +=1
    
if "R" in s:
  print(ans)
else:
  print(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):
N = input()

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

Solution (Python):
def main():
    s = input()
    d = {
    'SSS': 0,
    'SSR': 1,
    'SRS': 1,
    'SRR': 2,
    'RSS': 1,
    'RSR': 1,
    'RRS': 2,
    'RRR': 3
    }
    print(d[s])

if __name__ == '__main__':
    main()

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

Solution (Python):
S=input()
if S.count("RRR"):
  D=3
elif S.count("SSS"):
  D=0
elif S.count("RR"):
  D=2
else:
  D=1
print(D)

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 = list(input())
stre = 0
ans = 0
for i in S:
    if i == "R":
        stre += 1
        if stre > ans:
            ans = stre
    else:
        stre = 0
print(ans)

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

Solution (Python):
days = input()
ans = 0
for i in days:
    if i == 'R':
        ans += 1
        break
for i in range(1,len(days)):
    if days[i] == days[i-1] and days[i] == 'R':
        ans += 1
print(ans)

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

    
if '__main__' == __name__:
    resolve()

Solution (Python):
s = input()

count = s.count('R')
if count == 2:
    if s[1] == 'S':
        print(1)
        exit()
    else:
        print(2)
        exit()
print(count)

Solution (Python):
a=input()
b=0
if a=="SSS": b=0
elif a=="SSR" or a=="SRS" or a=="RSS" or a=="RSR": b=1
elif a=="SRR" or a=="RRS": b=2
elif a=="RRR": b=3
print(b)

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

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

Solution (Python):
s = input()

if s == 'RRR':
    print(3)
    exit()
if s.find('RR') >= 0:
    print(2)
    exit()
if s.find('R') >= 0:
    print(1)
    exit()
print(0)

Solution (Python):
input_str = input()
cnt = 0
max_cnt = 0
for tmp in input_str:
    if tmp == "R":
        cnt +=1
        max_cnt = max(cnt, max_cnt)
    else:
        cnt = 0
        
print(max_cnt)

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

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

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

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.find('RRR')>=0:
    print(3)
elif S.find('RR')>=0:
    print(2)
elif S.find('R')>=0:
    print(1)
else:
    print(0)

Solution (Python):
N = input()

if N.find("RRR") != -1:
    print(3)
else:
    if N.find("RR") != -1:
        print(2)
    else:
        if N.find("R") != -1:
            print(1)
        else:
            print(0)

Solution (Python):
x = input()

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

Solution (Python):
import sys,math
try:sys.stdin,sys.stdout=open('input.txt','r'),open('out.txt','w')
except:pass
from sys import stdin,stdout;mod=int(1e9 + 7);from statistics import mode
from collections import *;from math import ceil,floor,inf,factorial,gcd,log2,sqrt,log
ii1=lambda:int(stdin.readline().strip())
is1=lambda:stdin.readline().strip()
iia=lambda:list(map(int,stdin.readline().strip().split()))
isa=lambda:stdin.readline().strip().split()


def lcm(a,b): return (a*b)//gcd(a,b)
def setbits(n):return bin(n).count('1')
def resetbits(n):return bin(n).count('0')
def modinv(n,p):return pow(n,p-2,p)
def ncr(n,r):
    num,den=1,1;r=min(n,n-r)
    for i in range(r):num*=(n-i);den*=(i+1)
    return num//den
def ncr_p(n, r, p):
    num,den=1,1;r=min(r,n-r)
    for i in range(r):num = (num * (n - i)) % p ;den = (den * (i + 1)) % p
    return (num * modinv(den,p)) % p
def isPrime(num) :
    if num<=1:return False
    if num==2 or n==3:return True
    if (num % 2 == 0 or num % 3 == 0) :return False
    m = int(num**0.5)+1
    for i in range(5,m,6):
        if (num % i == 0 or num % (i + 2) == 0) :return False
    return True
def bin_search(arr, low, high, val):
    while low <= high:
        mid = low + (high - low) // 2;
        if arr[mid] == val:return mid
        elif arr[mid] < val:low = mid + 1
        else:high = mid - 1
    return -1
def sumofdigit(num):
    count=0;
    while num : count+=num % 10;num //= 10;
    return count;
def inputmatrix():
    r,c=iia();mat=[0]*r;
    for i in range(r):mat[i]=iia();
    return r,c,mat;
def prefix_sum(n,arr):
    for i in range(1,n):arr[i]+=arr[i-1]
    return arr;
def binomial(n, k):
    if 0 <= k <= n:
        ntok = 1;ktok = 1
        for t in range(1, min(k, n - k) + 1):ntok *= n;ktok *= t;n -= 1
        return ntok // ktok
    else:return 0
def divisors(n):
    res = [];
    for i in range(1,ceil(sqrt(n))+1):
        if n%i == 0:
            if i==n//i:res.append(i)
            else:res.append(i);res.append(n//i)
    return res;


s=is1()
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[1]=='R' or s[2]=='R':
    print(1)
else:
    print(0)

Solution (Python):
import sys
W = input()

ans = 0
if W[:] == "RRR":
    print(3)
    sys.exit(0)
elif W[:2] == "RR" or W[1:] == "RR":
    print(2)
    sys.exit(0)
elif "R" in W:
    print(1)
    sys.exit(0)
print(0)

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

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

Solution (Python):
S = input()

cnt=0

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

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

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

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

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

print(ans)

Solution (Python):
s=input()

r=[]
l=0

for i in range(len(s)):

    if s[i]=='R':
        l+=1

    else:
         if l!=0:
            r.append(l)
            l=0

if l!=0:
    r.append(l)
if len(r):    
   
   print(max(r))    
else:
    print(0)

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

count = 1

for i in range(len(s)-1):
  if s.count("R") == 0:
    count = 0
  elif s[i] == "R" and s[i+1] == "R":
    count += 1
    
print(count)

Solution (Python):
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math
import bisect

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

s = input()

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

Solution (Python):


S = input()

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

Solution (Python):
ans = 0
answer = []
S = input()
for s in S:
    if s == "R":
        ans += 1
    else:
        answer.append(ans)
        ans = 0
answer.append(ans)
print(max(answer))

Solution (Python):


"""
Created on Sat Aug 15 17:30:06 2020

@author: divyarth
"""

import sys
import heapq
import math





from collections import deque
from collections import defaultdict
from collections import Counter

modH=int(10**9)+7
I=lambda : list(map(int,input().split(' ')))
def PRINT(lst,sep=' '): print(sep.join(map(str,lst)))

s=input()
stack=[]
mm=0
for i in range(len(s)):
    if s[i]=='R':
        stack.append('R')
    else:
        cnt=0
        while len(stack):
            stack.pop()
            cnt+=1
        mm=max(mm,cnt)        
cnt=0
while len(stack):
    stack.pop()
    cnt+=1
mm=max(mm,cnt)
print(mm)

Solution (Python):









def solve():
    weather = input()
    if weather == 'RRR':
        return 3
    elif weather == 'SRR':
        return 2
    elif weather == 'RSR':
        return 1
    elif weather == 'RRS':
        return 2
    elif weather == 'SSS':
        return 0
    else:
        return 1


def main():
    print(solve())


if __name__ == "__main__":
    main()

Solution (Python):
from sys import stdin, stdout
import math,sys,heapq
from itertools import permutations, combinations
from collections import defaultdict,deque,OrderedDict
from os import path
import bisect as bi
def yes():print('YES')
def no():print('NO')
if (path.exists('input.txt')): 
    
    sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w');
    def I():return (int(input()))
    def In():return(map(int,input().split()))
else:
    
    def I():return (int(stdin.readline()))
    def In():return(map(int,stdin.readline().split()))

def dict(a):
    d={} 
    for x in a:
        if d.get(x,-1)!=-1:
            d[x]+=1
        else:
            d[x]=1
    return d


def find_gt(a, x):
    'Find leftmost value greater than x'
    i = bi.bisect_right(a, x)
    if i != len(a):
        return i
    else:            
        return -1

def main():
    try:
        l=list(input())
        if l[0]=='R' and l[1]=='R' and l[2]=='R':
            ans=3
            print(ans)
            return
        if (l[0]=='R' and l[1]=='R') or (l[1]=='R' and l[2]=='R'):
            ans=2
            print(ans)
            return
        else:
            ans=0
            for x in range(3):
                if l[x]=='R':
                    ans=1
                    break
            print(ans)
    except: 
        pass
        
M = 998244353
P = 1000000007
Inf=1000000000000000000
if __name__ == '__main__':
    
    for _ in range(1):main()

Solution (Python):
s = list(input())
l = []

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

print(max(l))

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

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

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

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

Solution (Python):
import math

s = input()

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

Solution (Python):
n = list(input())
n_r = len([i for i in n if i == "R"])

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

Solution (Python):
s=input()
count=0
count1=0
for i in s:
    if i=='R':
        count+=1
        if count1<count:
            count1=count
    else:
        count=0
print(count1)

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

Solution (Python):
import sys

def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    S = str(input())

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

    

if __name__ == "__main__":
	main()

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

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

Solution (Python):
import sys
import numpy as np
X = str(input())

d = 0
s = 0
for i in X:
    if i == 'R':
        d += 1
    else:
        if s < d:
            s = d
        d = 0
if s < d:
    s = d

print(s)

Solution (Python):
S = input()

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

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):
l = input()
if(l.count("RRR")==1):
    print(3)
elif(l.count("RR")==1):
    print(2)
elif(l.count("R")>=1):
    print(1)
else:
    print(0)

Solution (Python):
import sys


def resolve(in_):
    S = in_.read().strip().split('S')

    ans = max(len(s) for s in S)
    return ans
    

def main():
    answer = resolve(sys.stdin)
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):

s = input()

maxs = 0
ans = []
for a in s:
    if a == 'R':
        maxs += 1
    else:
        ans.append(maxs)
        maxs = 0


ans.append(maxs)
print(max(ans))

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

flag = True
count = 0
if (S[0] == "R"):
    count += 1
else:
    flag = False

if (S[1] == "R"):
    count += 1
    flag = True
else:
    flag = False

if (S[2] == "R"):
    if (flag):
        count += 1
    else:
        count = 1

print(count)

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

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

Solution (Python):
N=list(input())
if "R" in N:
    if N[1]=="R":
        if N.count("R")==2:
            print(2)
        elif N.count("R")==1:
            print(1)
        else:
            print(3)
    else:
        print(1)
else:
    print(0)

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

Solution (Python):
S = input()
List = list(S)
res = 0
if List[0] == "R":
  res = 1
for i in range(1,3):
  if List[i-1] == "R" and List[i] == "R":
    res +=1
  elif List[i-1] == "S" and List[i] == "R":
    res = 1
  else:
    pass
print(res)

Solution (Python):
S=input()
if S=="RRR":print(3)
elif S[0]=='R' and S[1]=='R':print(2)
elif 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):
import sys
input = sys.stdin.readline


def print_ans(S):
    """Test Case
    >>> print_ans("RRS")
    2
    >>> print_ans("SSS")
    0
    >>> print_ans("RSR")
    1
    """
    count = 0
    maximum = 0
    for a in S:
        if a == "R":
            count += 1
        else:
            count = 0
        maximum = max(count, maximum)
    print(maximum)


if __name__ == '__main__':
    S = input().rstrip()
    print_ans(S)

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

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

Solution (Python):
S = input()
if S == 'SSS':
    print(0)
elif S.count('R')==1:
    print(1)
elif S.count('R')==2:
    if S == 'RSR':
        print(1)
    else:
        print(2)
else:
    print(3)

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 range(3):
    if s[i] == 'R':
        tmp += 1
    else:
        ans = max(ans, tmp)
        tmp = 0
print(max(ans, tmp))

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

Solution (Python):

import sys


def solve(S: str):
    if S == "RRR":
        print(3)
    elif S == "SRR" or S == "RRS":
        print(2)
    elif S.count("R") == 2 or S.count("R") == 1:
        print(1)
    else:
        print(0)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    S = next(tokens)  
    solve(S)

if __name__ == '__main__':
    main()

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

count = 0
for i in range(3):
  if a[i] == 'R':
    count += 1
  elif count > 0 and a[i] != 'R':
    break

print(str(count))

Solution (Python):

"""
Created on Sat Aug 15 17:30:26 2020

@author: HP
"""


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()
count = 0
m = 0
for c in s:
    if(c == "R"):
        count+=1
if count != 2:
    print(count)
elif s[1] == "S":
    print(1)
else:
    print(2)

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):
def main():
    s = input()
    pre = ''
    start = False
    count = 0
    for c in s:
        if not start and c == 'R':
            start = True
            count = 1
        if start and c == 'R' == pre:
            count += 1
        pre = c
    print(count)


if __name__ == '__main__':
    main()

Solution (Python):
S = list(input())
ans = 0
ls = []
for i in S:
    if i == 'R':
        ans += 1
    else:
        ans = 0
    ls.append(ans)
print(max(ls))