line = input()
rain_day = 0
k = 0
for wether in line:
  #当日雨
  if wether == "R":
    rain_day += 1
  #当日晴れ、前日は雨
  elif rain_day != 0:
    k = rain_day
    rain_day = 0
  #当日晴れ、前日も晴れ
  else:
    pass
if k > rain_day:
  print(k)
else:
  print(rain_day) line = input() line input() input rain_day = 0 rain_day 0 k = 0 k 0 for wether in line:
  #当日雨
  if wether == "R":
    rain_day += 1
  #当日晴れ、前日は雨
  elif rain_day != 0:
    k = rain_day
    rain_day = 0
  #当日晴れ、前日も晴れ
  else:
    pass wether line if wether == "R":
    rain_day += 1
  #当日晴れ、前日は雨
  elif rain_day != 0:
    k = rain_day
    rain_day = 0
  #当日晴れ、前日も晴れ
  else:
    pass wether == "R" wether "R" rain_day += 1 rain_day 1 elif rain_day != 0:
    k = rain_day
    rain_day = 0
  #当日晴れ、前日も晴れ
   rain_day != 0 rain_day 0 k = rain_day k rain_day rain_day = 0 rain_day 0 if k > rain_day:
  print(k)
else:
  print(rain_day) k > rain_day k rain_day print(k) print k print(rain_day) print rain_day rain_day += 1 1 rain_day rain_day = 0 0 rain_day rain_day = 0 0 rain_day line = input() input() line k = 0 0 k k = rain_day rain_day k
line = input()
rain_day = 0
k = 0
for wether in line:
  #当日雨
  if wether == "R":
    rain_day += 1
  #当日晴れ、前日は雨
  elif rain_day != 0:
    k = rain_day
    rain_day = 0
  #当日晴れ、前日も晴れ
  else:
    pass
if k > rain_day:
  print(k)
else:
  print(rain_day)