S = input()
if S == 'RRR':
    print(3)
elif S == 'SSS':
    print(0)
elif S=='RSS' or S == 'SRS' or S=='SSR' or S=='RSR':
    print(1)
else:
    print(2) S = input() S input() input if S == 'RRR':
    print(3)
elif S == 'SSS':
    print(0)
elif S=='RSS' or S == 'SRS' or S=='SSR' or S=='RSR':
    print(1)
else:
    print(2) S == 'RRR' S 'RRR' print(3) print 3 elif S == 'SSS':
    print(0) S == 'SSS' S 'SSS' print(0) print 0 elif S=='RSS' or S == 'SRS' or S=='SSR' or S=='RSR':
    print(1) S=='RSS' or S == 'SRS' or S=='SSR' or S=='RSR' S=='RSS' or S == 'SRS' or S=='SSR' S=='RSS' or S == 'SRS' S=='RSS' S 'RSS' S == 'SRS' S 'SRS' S=='SSR' S 'SSR' S=='RSR' S 'RSR' print(1) print 1 print(2) print 2 S = input() input() S
S = input()
if S == 'RRR':
    print(3)
elif S == 'SSS':
    print(0)
elif S=='RSS' or S == 'SRS' or S=='SSR' or S=='RSR':
    print(1)
else:
    print(2)