s = input()
if s in ["RRR"]:
        print(3)
if s in ["RRS",  "SRR"]:
        print(2)
if s in ["RSR", "RSS", "SRS", "SSR"]:
        print(1)
if s == "SSS":
        print(0) s = input() s input() input if s in ["RRR"]:
        print(3) s in ["RRR"] s ["RRR"] "RRR" print(3) print 3 if s in ["RRS",  "SRR"]:
        print(2) s in ["RRS",  "SRR"] s ["RRS",  "SRR"] "RRS" "SRR" print(2) print 2 if s in ["RSR", "RSS", "SRS", "SSR"]:
        print(1) s in ["RSR", "RSS", "SRS", "SSR"] s ["RSR", "RSS", "SRS", "SSR"] "RSR" "RSS" "SRS" "SSR" print(1) print 1 if s == "SSS":
        print(0) s == "SSS" s "SSS" print(0) print 0 s = input() input() s
s = input()
if s in ["RRR"]:
        print(3)
if s in ["RRS",  "SRR"]:
        print(2)
if s in ["RSR", "RSS", "SRS", "SSR"]:
        print(1)
if s == "SSS":
        print(0)