S=input()
N=0
if S[0]=="R":
    N+=1
    if S[1]=="R":
        N+=1
        if S[2]=="R":
            N+=1
elif S[1]=="R":
    N+=1
    if S[2]=="R":
        N+=1
elif S[2]=="R":
    N+=1
print(N) S=input() S input() input N=0 N 0 if S[0]=="R":
    N+=1
    if S[1]=="R":
        N+=1
        if S[2]=="R":
            N+=1
elif S[1]=="R":
    N+=1
    if S[2]=="R":
        N+=1
elif S[2]=="R":
    N+=1 S[0]=="R" S[0] S 0 "R" N+=1 N 1 if S[1]=="R":
        N+=1
        if S[2]=="R":
            N+=1 S[1]=="R" S[1] S 1 "R" N+=1 N 1 if S[2]=="R":
            N+=1 S[2]=="R" S[2] S 2 "R" N+=1 N 1 elif S[1]=="R":
    N+=1
    if S[2]=="R":
        N+=1 S[1]=="R" S[1] S 1 "R" N+=1 N 1 if S[2]=="R":
        N+=1 S[2]=="R" S[2] S 2 "R" N+=1 N 1 elif S[2]=="R":
    N+=1 S[2]=="R" S[2] S 2 "R" N+=1 N 1 print(N) print N N+=1 1 N N+=1 1 N N=0 0 N N+=1 1 N N+=1 1 N N+=1 1 N S=input() input() S N+=1 1 N
S=input()
N=0
if S[0]=="R":
    N+=1
    if S[1]=="R":
        N+=1
        if S[2]=="R":
            N+=1
elif S[1]=="R":
    N+=1
    if S[2]=="R":
        N+=1
elif S[2]=="R":
    N+=1
print(N)