s = input()
ans = 0
if (s[0]=='R' and s[1]=='R') and s[2]=='R':
    ans = 3
elif (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'):
    ans = 2
if ans == 0:
    for i in range(3):
        if s[i]=='R':
            ans = 1
print(ans) s = input() s input() input ans = 0 ans 0 if (s[0]=='R' and s[1]=='R') and s[2]=='R':
    ans = 3
elif (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'):
    ans = 2 (s[0]=='R' and s[1]=='R') and s[2]=='R' s[0]=='R' and s[1]=='R' s[0]=='R' s[0] s 0 'R' s[1]=='R' s[1] s 1 'R' s[2]=='R' s[2] s 2 'R' ans = 3 ans 3 elif (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'):
    ans = 2 (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R') s[0]=='R' and s[1]=='R' s[0]=='R' s[0] s 0 'R' s[1]=='R' s[1] s 1 'R' s[1]=='R' and s[2]=='R' s[1]=='R' s[1] s 1 'R' s[2]=='R' s[2] s 2 'R' ans = 2 ans 2 if ans == 0:
    for i in range(3):
        if s[i]=='R':
            ans = 1 ans == 0 ans 0 for i in range(3):
        if s[i]=='R':
            ans = 1 i range(3) range 3 if s[i]=='R':
            ans = 1 s[i]=='R' s[i] s i 'R' ans = 1 ans 1 print(ans) print ans ans = 0 0 ans ans = 2 2 ans s = input() input() s ans = 3 3 ans ans = 1 1 ans
s = input()
ans = 0
if (s[0]=='R' and s[1]=='R') and s[2]=='R':
    ans = 3
elif (s[0]=='R' and s[1]=='R')or(s[1]=='R' and s[2]=='R'):
    ans = 2
if ans == 0:
    for i in range(3):
        if s[i]=='R':
            ans = 1
print(ans)
