s = input()
cnt = 0
if s[1] == 'S':
    if 'R' in s:
        cnt += 1
else:
    cnt += 1
    if s[0] == 'R':
        cnt += 1
    if s[2] == 'R':
        cnt += 1
print(cnt) s = input() s input() input cnt = 0 cnt 0 if s[1] == 'S':
    if 'R' in s:
        cnt += 1
else:
    cnt += 1
    if s[0] == 'R':
        cnt += 1
    if s[2] == 'R':
        cnt += 1 s[1] == 'S' s[1] s 1 'S' if 'R' in s:
        cnt += 1 'R' in s 'R' s cnt += 1 cnt 1 cnt += 1 cnt 1 if s[0] == 'R':
        cnt += 1
     s[0] == 'R' s[0] s 0 'R' cnt += 1 cnt 1 if s[2] == 'R':
        cnt += 1 s[2] == 'R' s[2] s 2 'R' cnt += 1 cnt 1 print(cnt) print cnt s = input() input() s cnt += 1 1 cnt cnt += 1 1 cnt cnt += 1 1 cnt cnt = 0 0 cnt cnt += 1 1 cnt
s = input()
cnt = 0
if s[1] == 'S':
    if 'R' in s:
        cnt += 1
else:
    cnt += 1
    if s[0] == 'R':
        cnt += 1
    if s[2] == 'R':
        cnt += 1
print(cnt)
