n = int(input())
c = list(input())
r = [0]
w = [0]
for i in range(n):
    if c[i] == "W":
        w.append(w[-1]+1)
    else:
        w.append(w[-1])
    if c[i] == "R":
        r.append(r[-1]+1)
    else:
        r.append(r[-1])

ans = float('inf')
for i in range(n+1):
    r_left = r[i]
    r_right = r[-1] - r[i]
    w_left = w[i]
    w_right = w[-1] - w[i]
    
    ans = min(ans,max(r_right,w_left))

print(ans) n = int(input()) n int(input()) int input() input c = list(input()) c list(input()) list input() input r = [0] r [0] 0 w = [0] w [0] 0 for i in range(n):
    if c[i] == "W":
        w.append(w[-1]+1)
    else:
        w.append(w[-1])
    if c[i] == "R":
        r.append(r[-1]+1)
    else:
        r.append(r[-1]) i range(n) range n if c[i] == "W":
        w.append(w[-1]+1)
    else:
        w.append(w[-1])
     c[i] == "W" c[i] c i "W" w.append(w[-1]+1) w.append w append w[-1]+1 w[-1] w -1 1 w.append(w[-1]) w.append w append w[-1] w -1 if c[i] == "R":
        r.append(r[-1]+1)
    else:
        r.append(r[-1]) c[i] == "R" c[i] c i "R" r.append(r[-1]+1) r.append r append r[-1]+1 r[-1] r -1 1 r.append(r[-1]) r.append r append r[-1] r -1 ans = float('inf') ans float('inf') float 'inf' for i in range(n+1):
    r_left = r[i]
    r_right = r[-1] - r[i]
    w_left = w[i]
    w_right = w[-1] - w[i]
    
    ans = min(ans,max(r_right,w_left)) i range(n+1) range n+1 n 1 r_left = r[i] r_left r[i] r i r_right = r[-1] - r[i] r_right r[-1] - r[i] r[-1] r -1 r[i] r i w_left = w[i] w_left w[i] w i w_right = w[-1] - w[i] w_right w[-1] - w[i] w[-1] w -1 w[i] w i ans = min(ans,max(r_right,w_left)) ans min(ans,max(r_right,w_left)) min ans max(r_right,w_left) max r_right w_left print(ans) print ans w_left = w[i] w[i] w_left r = [0] [0] r r_left = r[i] r[i] r_left w_right = w[-1] - w[i] w[-1] - w[i] w_right n = int(input()) int(input()) n ans = float('inf') float('inf') ans w = [0] [0] w c = list(input()) list(input()) c ans = min(ans,max(r_right,w_left)) min(ans,max(r_right,w_left)) ans r_right = r[-1] - r[i] r[-1] - r[i] r_right
n = int(input())
c = list(input())
r = [0]
w = [0]
for i in range(n):
    if c[i] == "W":
        w.append(w[-1]+1)
    else:
        w.append(w[-1])
    if c[i] == "R":
        r.append(r[-1]+1)
    else:
        r.append(r[-1])

ans = float('inf')
for i in range(n+1):
    r_left = r[i]
    r_right = r[-1] - r[i]
    w_left = w[i]
    w_right = w[-1] - w[i]
    
    ans = min(ans,max(r_right,w_left))

print(ans)