s = input()
if s == 'RRR':
    print(3)
elif s == 'RRS' or s == 'SRR':
    print(2)
elif s == 'SSS':
    print(0)
else:
    print(1) s = input() s input() input if s == 'RRR':
    print(3)
elif s == 'RRS' or s == 'SRR':
    print(2)
elif s == 'SSS':
    print(0)
else:
    print(1) 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 == 'SSS':
    print(0) s == 'SSS' s 'SSS' print(0) print 0 print(1) print 1 s = input() input() s
s = input()
if s == 'RRR':
    print(3)
elif s == 'RRS' or s == 'SRR':
    print(2)
elif s == 'SSS':
    print(0)
else:
    print(1)
