D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0) D = input() D input() input ans = 0 ans 0 ans_list = [] ans_list [] if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0) D.count("R") >= 1 D.count("R") D.count D count "R" 1 for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
   i range(3) range 3 if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
   D[i] == 'R' D[i] D i 'R' ans += 1 ans 1 ans_list.append(ans) ans_list.append ans_list append ans elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
   D[i] == 'S' D[i] D i 'S' ss = 0 ss 0 ans_list.append(ss) ans_list.append ans_list append ss if i > 0:
        ans = 0
   i > 0 i 0 ans = 0 ans 0 print(max(ans_list)) print max(ans_list) max ans_list elif D.count("R") < 1:
  print(0) D.count("R") < 1 D.count("R") D.count D count "R" 1 print(0) print 0 D = input() input() D ans = 0 0 ans ans_list = [] [] ans_list ans = 0 0 ans ss = 0 0 ss ans += 1 1 ans
D = input()
ans = 0
ans_list = []
if D.count("R") >= 1:
  for i in range(3):
    if D[i] == 'R':
      ans += 1
      ans_list.append(ans)
    elif D[i] == 'S':
      ss = 0
      ans_list.append(ss)
      if i > 0:
        ans = 0
  print(max(ans_list))
elif D.count("R") < 1:
  print(0)
