from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

s = S()

cnt = 0
max = 0
for i in s:
    if i == "R":
        cnt += 1
    else:
        if max < cnt:
            max = cnt
        cnt = 0

if max < cnt:
    max = cnt

print(max) from math import floor,ceil,sqrt,factorial,log from collections import Counter, deque from functools import reduce import numpy as np numpy import itertools itertools def S(): return input() S def I(): return int(input()) I def MS(): return map(str,input().split()) MS def MI(): return map(int,input().split()) MI int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i def FLI(): return [int(i) for i in input().split()] FLI def LS(): return list(MS()) LS def LI(): return list(MI()) LI list(map(str, l.split() )) for l in input() for l in input() l input() input for l in input() list(map(str, l.split() )) list map(str, l.split() ) map str l.split() l.split l split def LLS(): return [list(map(str, l.split() )) for l in input()] LLS list(map(int, l.split() )) for l in input() for l in input() l input() input for l in input() list(map(int, l.split() )) list map(int, l.split() ) map int l.split() l.split l split def LLI(): return [list(map(int, l.split() )) for l in input()] LLI LS() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LS() LS def LLSN(n: int): return [LS() for _ in range(n)] LLSN n: int n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LLIN(n: int): return [LI() for _ in range(n)] LLIN n: int n s = S() s S() S cnt = 0 cnt 0 max = 0 max 0 for i in s:
    if i == "R":
        cnt += 1
    else:
        if max < cnt:
            max = cnt
        cnt = 0 i s if i == "R":
        cnt += 1
    else:
        if max < cnt:
            max = cnt
        cnt = 0 i == "R" i "R" cnt += 1 cnt 1 if max < cnt:
            max = cnt
         max < cnt max cnt max = cnt max cnt cnt = 0 cnt 0 if max < cnt:
    max = cnt max < cnt max cnt max = cnt max cnt print(max) print max def MI(): return map(int,input().split()) def MI(): return map(int,input().split()) MI def S(): return input() def S(): return input() S max = 0 0 max def I(): return int(input()) def I(): return int(input()) I def MS(): return map(str,input().split()) def MS(): return map(str,input().split()) MS def LI(): return list(MI()) def LI(): return list(MI()) LI def LS(): return list(MS()) def LS(): return list(MS()) LS def LLSN(n: int): return [LS() for _ in range(n)] def LLSN(n: int): return [LS() for _ in range(n)] LLSN s = S() S() s max = cnt cnt max max = cnt cnt max def FLI(): return [int(i) for i in input().split()] def FLI(): return [int(i) for i in input().split()] FLI cnt = 0 0 cnt def LLS(): return [list(map(str, l.split() )) for l in input()] def LLS(): return [list(map(str, l.split() )) for l in input()] LLS def LLI(): return [list(map(int, l.split() )) for l in input()] def LLI(): return [list(map(int, l.split() )) for l in input()] LLI def LLIN(n: int): return [LI() for _ in range(n)] def LLIN(n: int): return [LI() for _ in range(n)] LLIN cnt = 0 0 cnt cnt += 1 1 cnt
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

s = S()

cnt = 0
max = 0
for i in s:
    if i == "R":
        cnt += 1
    else:
        if max < cnt:
            max = cnt
        cnt = 0

if max < cnt:
    max = cnt

print(max)