N = int(input())
C = input()
rcount = len([1 for c in C if c == "R"])

count = 0
r = 0
w = 0
for i in range(rcount):
    c = C[i]
    if c == "W":
        if r > 0:
            r -= 1
            count += 1
        else:
            w += 1
    c = C[N-i-1]
    if c == "R":
        if w > 0:
            w -= 1
            count += 1
        else:
            r += 1
ans = count + w
print(ans) N = int(input()) N int(input()) int input() input C = input() C input() input 1 for c in C if c == "R" for c in C if c == "R" c C c == "R" c "R" if c == "R" 1 rcount = len([1 for c in C if c == "R"]) rcount len([1 for c in C if c == "R"]) len [1 for c in C if c == "R"] count = 0 count 0 r = 0 r 0 w = 0 w 0 for i in range(rcount):
    c = C[i]
    if c == "W":
        if r > 0:
            r -= 1
            count += 1
        else:
            w += 1
    c = C[N-i-1]
    if c == "R":
        if w > 0:
            w -= 1
            count += 1
        else:
            r += 1 i range(rcount) range rcount c = C[i] c C[i] C i if c == "W":
        if r > 0:
            r -= 1
            count += 1
        else:
            w += 1
     c == "W" c "W" if r > 0:
            r -= 1
            count += 1
        else:
            w += 1
     r > 0 r 0 r -= 1 r 1 count += 1 count 1 w += 1 w 1 c = C[N-i-1] c C[N-i-1] C N-i-1 N-i N i 1 if c == "R":
        if w > 0:
            w -= 1
            count += 1
        else:
            r += 1 c == "R" c "R" if w > 0:
            w -= 1
            count += 1
        else:
            r += 1 w > 0 w 0 w -= 1 w 1 count += 1 count 1 r += 1 r 1 ans = count + w ans count + w count w print(ans) print ans c = C[N-i-1] C[N-i-1] c C = input() input() C w -= 1 1 w count += 1 1 count r += 1 1 r c = C[i] C[i] c N = int(input()) int(input()) N r = 0 0 r w = 0 0 w rcount = len([1 for c in C if c == "R"]) len([1 for c in C if c == "R"]) rcount r -= 1 1 r count += 1 1 count w += 1 1 w count = 0 0 count ans = count + w count + w ans
N = int(input())
C = input()
rcount = len([1 for c in C if c == "R"])

count = 0
r = 0
w = 0
for i in range(rcount):
    c = C[i]
    if c == "W":
        if r > 0:
            r -= 1
            count += 1
        else:
            w += 1
    c = C[N-i-1]
    if c == "R":
        if w > 0:
            w -= 1
            count += 1
        else:
            r += 1
ans = count + w
print(ans)