s = input()

three ='RRR'
two ='RR'
one ='R'

if  three in s:
    print('3')
elif two in s:
    print('2')
elif one in s:
    print('1')
    
else :
    print('0') s = input() s input() input three ='RRR' three 'RRR' two ='RR' two 'RR' one ='R' one 'R' if  three in s:
    print('3')
elif two in s:
    print('2')
elif one in s:
    print('1')
    
else :
    print('0') three in s three s print('3') print '3' elif two in s:
    print('2') two in s two s print('2') print '2' elif one in s:
    print('1')
     one in s one s print('1') print '1' print('0') print '0' three ='RRR' 'RRR' three s = input() input() s two ='RR' 'RR' two one ='R' 'R' one
s = input()

three ='RRR'
two ='RR'
one ='R'

if  three in s:
    print('3')
elif two in s:
    print('2')
elif one in s:
    print('1')
    
else :
    print('0')