s=input()
c=0
tmp=0
for i in range(3):
    if s[i]=='R':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0
print(c) s=input() s input() input c=0 c 0 tmp=0 tmp 0 for i in range(3):
    if s[i]=='R':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0 i range(3) range 3 if s[i]=='R':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0 s[i]=='R' s[i] s i 'R' tmp+=1 tmp 1 if c<tmp:
            c=tmp
     c<tmp c tmp c=tmp c tmp tmp=0 tmp 0 print(c) print c s=input() input() s c=0 0 c c=tmp tmp c tmp=0 0 tmp tmp+=1 1 tmp tmp=0 0 tmp
s=input()
c=0
tmp=0
for i in range(3):
    if s[i]=='R':
        tmp+=1
        if c<tmp:
            c=tmp
    else:
        tmp=0
print(c)