str = input()
cnt = 0
if str[0]=="R" and str[1]=="R" and str[2]=="R":
  cnt = 3
elif (str[0]=="R" and str[1]=="R") or (str[1]=="R" and str[2]=="R"):
  cnt = 2
elif str[0]=="R" or str[1]=="R" or str[2]=="R":
  cnt = 1
print(cnt) str = input() str input() input cnt = 0 cnt 0 if str[0]=="R" and str[1]=="R" and str[2]=="R":
  cnt = 3
elif (str[0]=="R" and str[1]=="R") or (str[1]=="R" and str[2]=="R"):
  cnt = 2
elif str[0]=="R" or str[1]=="R" or str[2]=="R":
  cnt = 1 str[0]=="R" and str[1]=="R" and str[2]=="R" str[0]=="R" and str[1]=="R" str[0]=="R" str[0] str 0 "R" str[1]=="R" str[1] str 1 "R" str[2]=="R" str[2] str 2 "R" cnt = 3 cnt 3 elif (str[0]=="R" and str[1]=="R") or (str[1]=="R" and str[2]=="R"):
  cnt = 2 (str[0]=="R" and str[1]=="R") or (str[1]=="R" and str[2]=="R") str[0]=="R" and str[1]=="R" str[0]=="R" str[0] str 0 "R" str[1]=="R" str[1] str 1 "R" str[1]=="R" and str[2]=="R" str[1]=="R" str[1] str 1 "R" str[2]=="R" str[2] str 2 "R" cnt = 2 cnt 2 elif str[0]=="R" or str[1]=="R" or str[2]=="R":
  cnt = 1 str[0]=="R" or str[1]=="R" or str[2]=="R" str[0]=="R" or str[1]=="R" str[0]=="R" str[0] str 0 "R" str[1]=="R" str[1] str 1 "R" str[2]=="R" str[2] str 2 "R" cnt = 1 cnt 1 print(cnt) print cnt str = input() input() str cnt = 1 1 cnt cnt = 3 3 cnt cnt = 0 0 cnt cnt = 2 2 cnt
str = input()
cnt = 0
if str[0]=="R" and str[1]=="R" and str[2]=="R":
  cnt = 3
elif (str[0]=="R" and str[1]=="R") or (str[1]=="R" and str[2]=="R"):
  cnt = 2
elif str[0]=="R" or str[1]=="R" or str[2]=="R":
  cnt = 1
print(cnt)