s = str(input())
array = list(s)
if array.count("R")==3:print(3)
elif s[1]==("R") and array.count("R")==2:print(2)
elif array.count("R")==0:print(0)
else:print(1) s = str(input()) s str(input()) str input() input array = list(s) array list(s) list s if array.count("R")==3:print(3)
elif s[1]==("R") and array.count("R")==2:print(2)
elif array.count("R")==0:print(0)
else:print(1) array.count("R")==3 array.count("R") array.count array count "R" 3 elif s[1]==("R") and array.count("R")==2:print(2) s[1]==("R") and array.count("R")==2 s[1]==("R") s[1] s 1 "R" array.count("R")==2 array.count("R") array.count array count "R" 2 elif array.count("R")==0:print(0) array.count("R")==0 array.count("R") array.count array count "R" 0 array = list(s) list(s) array s = str(input()) str(input()) s
s = str(input())
array = list(s)
if array.count("R")==3:print(3)
elif s[1]==("R") and array.count("R")==2:print(2)
elif array.count("R")==0:print(0)
else:print(1)