s = input()
if s == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
elif s == "RSS" or s == "RSR" or s == "SRS" or s == "SSR":
    print(1)
else:
    print(0) s = input() s input() input if s == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
elif s == "RSS" or s == "RSR" or s == "SRS" or s == "SSR":
    print(1)
else:
    print(0) s == "RRR" s "RRR" print(3) print 3 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 == "RSS" or s == "RSR" or s == "SRS" or s == "SSR":
    print(1) s == "RSS" or s == "RSR" or s == "SRS" or s == "SSR" s == "RSS" or s == "RSR" or s == "SRS" s == "RSS" or s == "RSR" s == "RSS" s "RSS" s == "RSR" s "RSR" s == "SRS" s "SRS" s == "SSR" s "SSR" print(1) print 1 print(0) print 0 s = input() input() s
s = input()
if s == "RRR":
    print(3)
elif s == "RRS" or s == "SRR":
    print(2)
elif s == "RSS" or s == "RSR" or s == "SRS" or s == "SSR":
    print(1)
else:
    print(0)
