s = input()

if s == "SSS":
    print("0")

elif s == "RRS" or s == "SRR":
    print("2")

elif s == "RRR":
    print("3")

else:
    print("1") s = input() s input() input if s == "SSS":
    print("0")

elif s == "RRS" or s == "SRR":
    print("2")

elif s == "RRR":
    print("3")

else:
    print("1") s == "SSS" s "SSS" print("0") print "0" elif s == "RRS" or s == "SRR":
    print("2") s == "RRS" or s == "SRR" s == "RRS" s "RRS" s == "SRR" s "SRR" print("2") print "2" elif s == "RRR":
    print("3") s == "RRR" s "RRR" print("3") print "3" print("1") print "1" s = input() input() s
s = input()

if s == "SSS":
    print("0")

elif s == "RRS" or s == "SRR":
    print("2")

elif s == "RRR":
    print("3")

else:
    print("1")
