#A問題

S = input()
if S == "RRR":
    print(3)
if S == "RRS"or S == "SRR" :
    print(2)
if S == "RSR"or S == "RSS" or S == "SRS" or S == "SSR":
    print(1)
if S == "SSS":
    print(0)  S = input() S input() input if S == "RRR":
    print(3) S == "RRR" S "RRR" print(3) print 3 if S == "RRS"or S == "SRR" :
    print(2) S == "RRS"or S == "SRR" S == "RRS" S "RRS" S == "SRR" S "SRR" print(2) print 2 if S == "RSR"or S == "RSS" or S == "SRS" or S == "SSR":
    print(1) S == "RSR"or S == "RSS" or S == "SRS" or S == "SSR" S == "RSR"or S == "RSS" or S == "SRS" S == "RSR"or S == "RSS" S == "RSR" S "RSR" S == "RSS" S "RSS" S == "SRS" S "SRS" S == "SSR" S "SSR" print(1) print 1 if S == "SSS":
    print(0)  S == "SSS" S "SSS" print(0) print 0 S = input() input() S
#A問題

S = input()
if S == "RRR":
    print(3)
if S == "RRS"or S == "SRR" :
    print(2)
if S == "RSR"or S == "RSS" or S == "SRS" or S == "SSR":
    print(1)
if S == "SSS":
    print(0) 