S = input()
if S.count("R") == 3:
    print(3)
elif S.count("R") == 2:
    if S[1] == "S":
        print("1")
    else:
        print("2")
elif S.count("R") == 1:
    print("1")
else:
    print("0") S = input() S input() input if S.count("R") == 3:
    print(3)
elif S.count("R") == 2:
    if S[1] == "S":
        print("1")
    else:
        print("2")
elif S.count("R") == 1:
    print("1")
else:
    print("0") S.count("R") == 3 S.count("R") S.count S count "R" 3 print(3) print 3 elif S.count("R") == 2:
    if S[1] == "S":
        print("1")
    else:
        print("2") S.count("R") == 2 S.count("R") S.count S count "R" 2 if S[1] == "S":
        print("1")
    else:
        print("2") S[1] == "S" S[1] S 1 "S" print("1") print "1" print("2") print "2" elif S.count("R") == 1:
    print("1") S.count("R") == 1 S.count("R") S.count S count "R" 1 print("1") print "1" print("0") print "0" S = input() input() S
S = input()
if S.count("R") == 3:
    print(3)
elif S.count("R") == 2:
    if S[1] == "S":
        print("1")
    else:
        print("2")
elif S.count("R") == 1:
    print("1")
else:
    print("0")