#!/usr/bin/env python3



s = eval(input())

if s == 'RRR':

    print((3))

    exit()

elif s == 'RRS' or s == 'SRR':

    print((2))

    exit()

elif s == 'RSR' or s == 'SRS' or s == 'RSS' or s == 'SSR':

    print((1))

    exit()

else:

    print((0))

    exit()



#!/usr/bin/env python3



s = eval(input())



if 'RRR' in s:

    print((3))

elif 'RR' in s:

    print((2))

elif 'R' in s:

    print((1))

else:

    print((0))

#!/usr/bin/env python3
s = eval(input())
if s == "RRR":
    print((3))
    exit()
elif s == "RRS" or s == "SRR":
    print((2))
    exit()
elif s == "RSR" or s == "SRS" or s == "RSS" or s == "SSR":
    print((1))
    exit()
else:
    print((0))
    exit()

#!/usr/bin/env python3
s = eval(input())
if "RRR" in s:
    print((3))
elif "RR" in s:
    print((2))
elif "R" in s:
    print((1))
else:
    print((0))

-if s == "RRR": +if "RRR" in s: -    exit() -elif s == "RRS" or s == "SRR": +elif "RR" in s: -    exit() -elif s == "RSR" or s == "SRS" or s == "RSS" or s == "SSR": +elif "R" in s: -    exit() -    exit()