s = input() + '@'

lst = [1]*len(s)
for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1

ans = 0
for i in range(0,len(s)):
	if s[i] == 'R':
		ans = max(ans,lst[i])

print(ans)
 s = input() + '@' s input() + '@' input() input '@' lst = [1]*len(s) lst [1]*len(s) [1] 1 len(s) len s for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1 i range(1,len(s)) range 1 len(s) len s if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1 s[i] == s[i-1] s[i] s i s[i-1] s i-1 i 1 lst[i] = lst[i-1] + 1 lst[i] lst i lst[i-1] + 1 lst[i-1] lst i-1 i 1 1 ans = 0 ans 0 for i in range(0,len(s)):
	if s[i] == 'R':
		ans = max(ans,lst[i]) i range(0,len(s)) range 0 len(s) len s if s[i] == 'R':
		ans = max(ans,lst[i]) s[i] == 'R' s[i] s i 'R' ans = max(ans,lst[i]) ans max(ans,lst[i]) max ans lst[i] lst i print(ans) print ans ans = 0 0 ans lst = [1]*len(s) [1]*len(s) lst ans = max(ans,lst[i]) max(ans,lst[i]) ans s = input() + '@' input() + '@' s
s = input() + '@'

lst = [1]*len(s)
for i in range(1,len(s)):
  if s[i] == s[i-1]:
    lst[i] = lst[i-1] + 1

ans = 0
for i in range(0,len(s)):
	if s[i] == 'R':
		ans = max(ans,lst[i])

print(ans)

