S=str(input())
 
if S.count('R')==0:
  print(0)
if S.count('R')==1 :
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1 and not S.count('RRR')==1:
  print(2)
if S.count('RRR')==1:
  print(3) S=str(input()) S str(input()) str input() input if S.count('R')==0:
  print(0) S.count('R')==0 S.count('R') S.count S count 'R' 0 print(0) print 0 if S.count('R')==1 :
  print(1) S.count('R')==1 S.count('R') S.count S count 'R' 1 print(1) print 1 if S.count('R')==2 and not S.count('RR') ==1:
  print(1) S.count('R')==2 and not S.count('RR') ==1 S.count('R')==2 S.count('R') S.count S count 'R' 2 not S.count('RR') ==1 S.count('RR') ==1 S.count('RR') S.count S count 'RR' 1 print(1) print 1 if S.count('RR')==1 and not S.count('RRR')==1:
  print(2) S.count('RR')==1 and not S.count('RRR')==1 S.count('RR')==1 S.count('RR') S.count S count 'RR' 1 not S.count('RRR')==1 S.count('RRR')==1 S.count('RRR') S.count S count 'RRR' 1 print(2) print 2 if S.count('RRR')==1:
  print(3) S.count('RRR')==1 S.count('RRR') S.count S count 'RRR' 1 print(3) print 3 S=str(input()) str(input()) S
S=str(input())
 
if S.count('R')==0:
  print(0)
if S.count('R')==1 :
  print(1)
if S.count('R')==2 and not S.count('RR') ==1:
  print(1)
if S.count('RR')==1 and not S.count('RRR')==1:
  print(2)
if S.count('RRR')==1:
  print(3)