import sys

n = list(input())
n1 = ['R','S','R']

i = 0
cou = 0
if n == n1:
    print(1)
    sys.exit()
while i != len(n):
    if n[i] == 'R':
        cou += 1
    i += 1
print(cou) import sys sys n = list(input()) n list(input()) list input() input n1 = ['R','S','R'] n1 ['R','S','R'] 'R' 'S' 'R' i = 0 i 0 cou = 0 cou 0 if n == n1:
    print(1)
    sys.exit() n == n1 n n1 print(1) print 1 sys.exit() sys.exit sys exit while i != len(n):
    if n[i] == 'R':
        cou += 1
    i += 1 i != len(n) i len(n) len n if n[i] == 'R':
        cou += 1
     n[i] == 'R' n[i] n i 'R' cou += 1 cou 1 i += 1 i 1 print(cou) print cou cou = 0 0 cou i = 0 0 i n = list(input()) list(input()) n i += 1 1 i cou += 1 1 cou n1 = ['R','S','R'] ['R','S','R'] n1
import sys

n = list(input())
n1 = ['R','S','R']

i = 0
cou = 0
if n == n1:
    print(1)
    sys.exit()
while i != len(n):
    if n[i] == 'R':
        cou += 1
    i += 1
print(cou)