from sys import stdin
n = int(stdin.readline())
c = stdin.readline()[:-1]

red = c.count("R")
ans = red
numwhite = 0
for i in range(n):
    numwhite += 1 if c[i] == "W" else 0
    numred = i - numwhite + 1
    resred = red - numred
    ans = min(ans,max(resred,numwhite))
print(ans) from sys import stdin n = int(stdin.readline()) n int(stdin.readline()) int stdin.readline() stdin.readline stdin readline c = stdin.readline()[:-1] c stdin.readline()[:-1] stdin.readline() stdin.readline stdin readline :-1 -1 red = c.count("R") red c.count("R") c.count c count "R" ans = red ans red numwhite = 0 numwhite 0 for i in range(n):
    numwhite += 1 if c[i] == "W" else 0
    numred = i - numwhite + 1
    resred = red - numred
    ans = min(ans,max(resred,numwhite)) i range(n) range n numwhite += 1 if c[i] == "W" else 0 numwhite 1 if c[i] == "W" else 0 c[i] == "W" c[i] c i "W" 1 0 numred = i - numwhite + 1 numred i - numwhite + 1 i - numwhite i numwhite 1 resred = red - numred resred red - numred red numred ans = min(ans,max(resred,numwhite)) ans min(ans,max(resred,numwhite)) min ans max(resred,numwhite) max resred numwhite print(ans) print ans n = int(stdin.readline()) int(stdin.readline()) n numred = i - numwhite + 1 i - numwhite + 1 numred numwhite += 1 if c[i] == "W" else 0 1 if c[i] == "W" else 0 numwhite ans = red red ans c = stdin.readline()[:-1] stdin.readline()[:-1] c resred = red - numred red - numred resred red = c.count("R") c.count("R") red numwhite = 0 0 numwhite ans = min(ans,max(resred,numwhite)) min(ans,max(resred,numwhite)) ans
from sys import stdin
n = int(stdin.readline())
c = stdin.readline()[:-1]

red = c.count("R")
ans = red
numwhite = 0
for i in range(n):
    numwhite += 1 if c[i] == "W" else 0
    numred = i - numwhite + 1
    resred = red - numred
    ans = min(ans,max(resred,numwhite))
print(ans)