# -*- coding: utf-8 -*-





def main():

    s = eval(input())



    # See:

    # https://atcoder.jp/contests/abc175/editorial/51

    # 1. 各文字がRと一致しているか

    # 2. 何文字一致しているか、を条件分岐

    first = s[0] == 'R'

    second = s[1] == 'R'

    third = s[2] == 'R'



    if first and second and third:

        print((3))

    elif (first and second) or (second and third):

        print((2))

    elif (first or second or third):

        print((1))

    else:

        print((0))





if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-





def main():

    s = eval(input())



    # See:

    # https://atcoder.jp/contests/abc175/submissions/15907467

    # Pythonのシンタックスを活用

    if 'RRR' in s:

        print((3))

    elif 'RR' in s:

        print((2))

    elif 'R' in s:

        print((1))

    else:

        print((0))





if __name__ == '__main__':

    main()

# -*- coding: utf-8 -*-
def main():
    s = eval(input())
    # See:
    # https://atcoder.jp/contests/abc175/editorial/51
    # 1. 各文字がRと一致しているか
    # 2. 何文字一致しているか、を条件分岐
    first = s[0] == "R"
    second = s[1] == "R"
    third = s[2] == "R"
    if first and second and third:
        print((3))
    elif (first and second) or (second and third):
        print((2))
    elif first or second or third:
        print((1))
    else:
        print((0))


if __name__ == "__main__":
    main()

# -*- coding: utf-8 -*-
def main():
    s = eval(input())
    # See:
    # https://atcoder.jp/contests/abc175/submissions/15907467
    # Pythonのシンタックスを活用
    if "RRR" in s:
        print((3))
    elif "RR" in s:
        print((2))
    elif "R" in s:
        print((1))
    else:
        print((0))


if __name__ == "__main__":
    main()

-    # https://atcoder.jp/contests/abc175/editorial/51 -    # 1. 各文字がRと一致しているか -    # 2. 何文字一致しているか、を条件分岐 -    first = s[0] == "R" -    second = s[1] == "R" -    third = s[2] == "R" -    if first and second and third: +    # https://atcoder.jp/contests/abc175/submissions/15907467 +    # Pythonのシンタックスを活用 +    if "RRR" in s: -    elif (first and second) or (second and third): +    elif "RR" in s: -    elif first or second or third: +    elif "R" in s: