import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


S = input()
if S == 'RSR':
    print(1)
else:
    print(S.count('R')) import sys sys sys.setrecursionlimit(300000) sys.setrecursionlimit sys setrecursionlimit 300000 def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) MI0 def LMI(): return list(map(int, sys.stdin.readline().split())) LMI def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) LMI0 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('inf') INF float('inf') float 'inf' S = input() S input() input if S == 'RSR':
    print(1)
else:
    print(S.count('R')) S == 'RSR' S 'RSR' print(1) print 1 print(S.count('R')) print S.count('R') S.count S count 'R' MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) MI0 INF = float('inf') float('inf') INF def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI def LMI(): return list(map(int, sys.stdin.readline().split())) def LMI(): return list(map(int, sys.stdin.readline().split())) LMI def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I S = input() input() S def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) LMI0
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


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