n = int(input())
s = input()
w = s.count("W")
r = s.count("R")

left_w = 0
right_r = r
count = [left_w+right_r]
for i in range(0, n):
    if s[i] == "W":
        left_w += 1
    else:
        right_r -=1
    #print(s[:i], s[i:], s[i], left_w, right_r)
    count.append(max(left_w,right_r))
print(min(count)) n = int(input()) n int(input()) int input() input s = input() s input() input w = s.count("W") w s.count("W") s.count s count "W" r = s.count("R") r s.count("R") s.count s count "R" left_w = 0 left_w 0 right_r = r right_r r count = [left_w+right_r] count [left_w+right_r] left_w+right_r left_w right_r for i in range(0, n):
    if s[i] == "W":
        left_w += 1
    else:
        right_r -=1
    #print(s[:i], s[i:], s[i], left_w, right_r)
    count.append(max(left_w,right_r)) i range(0, n) range 0 n if s[i] == "W":
        left_w += 1
    else:
        right_r -=1
    #print(s[:i], s[i:], s[i], left_w, right_r)
     s[i] == "W" s[i] s i "W" left_w += 1 left_w 1 right_r -=1 right_r 1 count.append(max(left_w,right_r)) count.append count append max(left_w,right_r) max left_w right_r print(min(count)) print min(count) min count right_r -=1 1 right_r left_w = 0 0 left_w right_r = r r right_r s = input() input() s left_w += 1 1 left_w n = int(input()) int(input()) n r = s.count("R") s.count("R") r count = [left_w+right_r] [left_w+right_r] count w = s.count("W") s.count("W") w
n = int(input())
s = input()
w = s.count("W")
r = s.count("R")

left_w = 0
right_r = r
count = [left_w+right_r]
for i in range(0, n):
    if s[i] == "W":
        left_w += 1
    else:
        right_r -=1
    #print(s[:i], s[i:], s[i], left_w, right_r)
    count.append(max(left_w,right_r))
print(min(count))