x = input()

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

if x == "RRR":
    print(3)
elif x == "RRS":
    print(2)
elif x == "SRR":
    print(2)
elif x == "SSS":
    print(0)
else:
    print(1)