import sys

input = sys.stdin.readline





def main():

    S = input().rstrip()

    if S == "RRR":

        print((3))

    elif S == "RRS":

        print((2))

    elif S == "SRR":

        print((2))

    elif S == "SSS":

        print((0))

    else:

        print((1))





if __name__ == "__main__":

    main()

import sys

input = sys.stdin.readline





def main():

    s = input().rstrip()

    rs = s.split("S")

    print((len(max(rs))))





if __name__ == "__main__":

    main()

import sys

input = sys.stdin.readline


def main():
    S = input().rstrip()
    if S == "RRR":
        print((3))
    elif S == "RRS":
        print((2))
    elif S == "SRR":
        print((2))
    elif S == "SSS":
        print((0))
    else:
        print((1))


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():
    s = input().rstrip()
    rs = s.split("S")
    print((len(max(rs))))


if __name__ == "__main__":
    main()

-    S = input().rstrip() -    if S == "RRR": -        print((3)) -    elif S == "RRS": -        print((2)) -    elif S == "SRR": -        print((2)) -    elif S == "SSS": -        print((0)) -    else: -        print((1)) +    s = input().rstrip() +    rs = s.split("S") +    print((len(max(rs))))