def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

s = inp()

if s == "RRR":
    print(3)
elif s == "SSS":
    print(0)
elif s == "RSS" or s == "SSR" or s == "RSR" or s == "SRS":
    print(1)
else:
    print(2) def inp():
    return input() inp return input() input() input def iinp():
    return int(input()) iinp return int(input()) int(input()) int input() input def inps():
    return input().split() inps return input().split() input().split() ().split () input split def miinps():
    return map(int,input().split()) miinps return map(int,input().split()) map(int,input().split()) map int input().split() ().split () input split def linps():
    return list(input().split()) linps return list(input().split()) list(input().split()) list input().split() ().split () input split def lmiinps():
    return list(map(int,input().split())) lmiinps return list(map(int,input().split())) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)] lmiinpsf list(map(int,input().split()))for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split return [list(map(int,input().split()))for _ in range(n)] [list(map(int,input().split()))for _ in range(n)] n n s = inp() s inp() inp if s == "RRR":
    print(3)
elif s == "SSS":
    print(0)
elif s == "RSS" or s == "SSR" or s == "RSR" or s == "SRS":
    print(1)
else:
    print(2) s == "RRR" s "RRR" print(3) print 3 elif s == "SSS":
    print(0) s == "SSS" s "SSS" print(0) print 0 elif s == "RSS" or s == "SSR" or s == "RSR" or s == "SRS":
    print(1) s == "RSS" or s == "SSR" or s == "RSR" or s == "SRS" s == "RSS" or s == "SSR" or s == "RSR" s == "RSS" or s == "SSR" s == "RSS" s "RSS" s == "SSR" s "SSR" s == "RSR" s "RSR" s == "SRS" s "SRS" print(1) print 1 print(2) print 2 def inp():
    return input() def inp():
    return input() inp def miinps():
    return map(int,input().split()) def miinps():
    return map(int,input().split()) miinps def linps():
    return list(input().split()) def linps():
    return list(input().split()) linps def lmiinps():
    return list(map(int,input().split())) def lmiinps():
    return list(map(int,input().split())) lmiinps def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)] def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)] lmiinpsf def iinp():
    return int(input()) def iinp():
    return int(input()) iinp s = inp() inp() s def inps():
    return input().split() def inps():
    return input().split() inps
def inp():
    return input()
def iinp():
    return int(input())
def inps():
    return input().split()
def miinps():
    return map(int,input().split())
def linps():
    return list(input().split())
def lmiinps():
    return list(map(int,input().split()))
def lmiinpsf(n):
    return [list(map(int,input().split()))for _ in range(n)]

s = inp()

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