n = int(eval(input()))

C = list(eval(input()))

r = C.count('R')

c = 0

for i in range(r, n):

    if C[i] == 'R': c += 1

print(c)

_ = int(eval(input()))

C = eval(input())

print((C[C.count('R'):].count('R')))

n = int(eval(input()))
C = list(eval(input()))
r = C.count("R")
c = 0
for i in range(r, n):
    if C[i] == "R":
        c += 1
print(c)

_ = int(eval(input()))
C = eval(input())
print((C[C.count("R") :].count("R")))

-n = int(eval(input())) -C = list(eval(input())) -r = C.count("R") -c = 0 -for i in range(r, n): -    if C[i] == "R": -        c += 1 -print(c) +_ = int(eval(input())) +C = eval(input()) +print((C[C.count("R") :].count("R")))