a = input()
b = list(a)
if b[0] == "R":
    if b[1] == "R":
        if b[2] == "R":
            print(3)
        else:
            print(2)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(1)
else:
    if b[1] == "R":
        if b[2] == "R":
            print(2)
        else:
            print(1)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(0) a = input() a input() input b = list(a) b list(a) list a if b[0] == "R":
    if b[1] == "R":
        if b[2] == "R":
            print(3)
        else:
            print(2)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(1)
else:
    if b[1] == "R":
        if b[2] == "R":
            print(2)
        else:
            print(1)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(0) b[0] == "R" b[0] b 0 "R" if b[1] == "R":
        if b[2] == "R":
            print(3)
        else:
            print(2)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(1) b[1] == "R" b[1] b 1 "R" if b[2] == "R":
            print(3)
        else:
            print(2)
     b[2] == "R" b[2] b 2 "R" print(3) print 3 print(2) print 2 if b[2] == "R":
            print(1)
        else:
            print(1) b[2] == "R" b[2] b 2 "R" print(1) print 1 print(1) print 1 if b[1] == "R":
        if b[2] == "R":
            print(2)
        else:
            print(1)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(0) b[1] == "R" b[1] b 1 "R" if b[2] == "R":
            print(2)
        else:
            print(1)
     b[2] == "R" b[2] b 2 "R" print(2) print 2 print(1) print 1 if b[2] == "R":
            print(1)
        else:
            print(0) b[2] == "R" b[2] b 2 "R" print(1) print 1 print(0) print 0 a = input() input() a b = list(a) list(a) b
a = input()
b = list(a)
if b[0] == "R":
    if b[1] == "R":
        if b[2] == "R":
            print(3)
        else:
            print(2)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(1)
else:
    if b[1] == "R":
        if b[2] == "R":
            print(2)
        else:
            print(1)
    else:
        if b[2] == "R":
            print(1)
        else:
            print(0)
