w=list(input())
n=len(w)
S=0
S_max=S
for i in range(n):
  if w[i]=='R':
    S+=1
    j=0
    while True:
      if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
  S_max=max([S_max,S])
  S=0
print(S_max) w=list(input()) w list(input()) list input() input n=len(w) n len(w) len w S=0 S 0 S_max=S S_max S for i in range(n):
  if w[i]=='R':
    S+=1
    j=0
    while True:
      if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
  S_max=max([S_max,S])
  S=0 i range(n) range n if w[i]=='R':
    S+=1
    j=0
    while True:
      if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
   w[i]=='R' w[i] w i 'R' S+=1 S 1 j=0 j 0 while True:
      if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
   True if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
   i+j+1<=n-1 i+j+1 i+j i j 1 n-1 n 1 j+=1 j 1 if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
       w[i+j]=='R' w[i+j] w i+j i j 'R' S+=1 S 1 i+=j i j break i=n-1 i n-1 n 1 break S_max=max([S_max,S]) S_max max([S_max,S]) max [S_max,S] S_max S S=0 S 0 print(S_max) print S_max n=len(w) len(w) n S_max=S S S_max S_max=max([S_max,S]) max([S_max,S]) S_max S=0 0 S S+=1 1 S S+=1 1 S i+=j j i i=n-1 n-1 i j+=1 1 j j=0 0 j w=list(input()) list(input()) w S=0 0 S
w=list(input())
n=len(w)
S=0
S_max=S
for i in range(n):
  if w[i]=='R':
    S+=1
    j=0
    while True:
      if i+j+1<=n-1:
        j+=1
        if w[i+j]=='R':
          S+=1
        else:
          i+=j
          break
      else:
        i=n-1
        break
  S_max=max([S_max,S])
  S=0
print(S_max)