N = int(input())
c = input()
red = 0

for i in c:
    if i=="R":
        red += 1

br = 0
ans = 10**12 if red else 0
for i in range(red):
    if c[i]=="R":
        br += 1
    white = i+1 - br
    disappear = red - br - white
    ans = min(ans, white+disappear)

print(ans) N = int(input()) N int(input()) int input() input c = input() c input() input red = 0 red 0 for i in c:
    if i=="R":
        red += 1 i c if i=="R":
        red += 1 i=="R" i "R" red += 1 red 1 br = 0 br 0 ans = 10**12 if red else 0 ans 10**12 if red else 0 red 10**12 10 12 0 for i in range(red):
    if c[i]=="R":
        br += 1
    white = i+1 - br
    disappear = red - br - white
    ans = min(ans, white+disappear) i range(red) range red if c[i]=="R":
        br += 1
     c[i]=="R" c[i] c i "R" br += 1 br 1 white = i+1 - br white i+1 - br i+1 i 1 br disappear = red - br - white disappear red - br - white red - br red br white ans = min(ans, white+disappear) ans min(ans, white+disappear) min ans white+disappear white disappear print(ans) print ans red += 1 1 red br = 0 0 br c = input() input() c white = i+1 - br i+1 - br white ans = min(ans, white+disappear) min(ans, white+disappear) ans ans = 10**12 if red else 0 10**12 if red else 0 ans red = 0 0 red br += 1 1 br N = int(input()) int(input()) N disappear = red - br - white red - br - white disappear
N = int(input())
c = input()
red = 0

for i in c:
    if i=="R":
        red += 1

br = 0
ans = 10**12 if red else 0
for i in range(red):
    if c[i]=="R":
        br += 1
    white = i+1 - br
    disappear = red - br - white
    ans = min(ans, white+disappear)

print(ans)
