n=int(eval(input()))

c=eval(input())

r=c.count("R")

r_1=c[:r].count("R")

ans=r-r_1

print(ans)
n=int(eval(input()))

s = eval(input())

Ra = s.count('R')

t = s[:Ra]

Rb = t.count('R')

print((Ra-Rb))
n = int(eval(input()))
c = eval(input())
r = c.count("R")
r_1 = c[:r].count("R")
ans = r - r_1
print(ans)

n = int(eval(input()))
s = eval(input())
Ra = s.count("R")
t = s[:Ra]
Rb = t.count("R")
print((Ra - Rb))

-c = eval(input()) -r = c.count("R") -r_1 = c[:r].count("R") -ans = r - r_1 -print(ans) +s = eval(input()) +Ra = s.count("R") +t = s[:Ra] +Rb = t.count("R") +print((Ra - Rb))