n=int(eval(input()))

s=eval(input())

cnt=0

ri=len(s)-1

for li,ss in enumerate(s):

  if ss=="W":

    while ri>li and s[ri]=="W":

      ri-=1

    if ri<=li:

      break

    ri-=1

    cnt+=1

print(cnt)

  
n=int(eval(input()))

s=eval(input())



rcnt=s.count("R")

wcnt=s[:rcnt].count("W")

print(wcnt)
n = int(eval(input()))
s = eval(input())
cnt = 0
ri = len(s) - 1
for li, ss in enumerate(s):
    if ss == "W":
        while ri > li and s[ri] == "W":
            ri -= 1
        if ri <= li:
            break
        ri -= 1
        cnt += 1
print(cnt)

n = int(eval(input()))
s = eval(input())
rcnt = s.count("R")
wcnt = s[:rcnt].count("W")
print(wcnt)

-cnt = 0 -ri = len(s) - 1 -for li, ss in enumerate(s): -    if ss == "W": -        while ri > li and s[ri] == "W": -            ri -= 1 -        if ri <= li: -            break -        ri -= 1 -        cnt += 1 -print(cnt) +rcnt = s.count("R") +wcnt = s[:rcnt].count("W") +print(wcnt)