S = input()

A = S.count("R")
B = S.count("RR")

if A==2:
    if B==1:
        print(2)
    if B==0:
        print(1)

elif  A==1:
    print(1)

elif A==3:
    print(3)
else :
    print(0) S = input() S input() input A = S.count("R") A S.count("R") S.count S count "R" B = S.count("RR") B S.count("RR") S.count S count "RR" if A==2:
    if B==1:
        print(2)
    if B==0:
        print(1)

elif  A==1:
    print(1)

elif A==3:
    print(3)
else :
    print(0) A==2 A 2 if B==1:
        print(2)
     B==1 B 1 print(2) print 2 if B==0:
        print(1) B==0 B 0 print(1) print 1 elif  A==1:
    print(1) A==1 A 1 print(1) print 1 elif A==3:
    print(3) A==3 A 3 print(3) print 3 print(0) print 0 B = S.count("RR") S.count("RR") B A = S.count("R") S.count("R") A S = input() input() S
S = input()

A = S.count("R")
B = S.count("RR")

if A==2:
    if B==1:
        print(2)
    if B==0:
        print(1)

elif  A==1:
    print(1)

elif A==3:
    print(3)
else :
    print(0)