n = int(input())
c = list(input())
wcount = [0] * n
rcount = [0] * n
for i in range(n):
    if c[i] == 'W':
        wcount[i] = 1
    if c[-(i+1)] == 'R':
        rcount[-(i+1)] = 1
    if i != 0:
        wcount[i] = wcount[i] + wcount[i-1]
        rcount[-(i+1)] = rcount[-(i+1)] + rcount[-i]
ans = n
for i in range(n+1):
    if i == 0:
        W = 0
        R = rcount[0]
    elif i == n:
        W = wcount[-1]
        R = 0
    else:
        W = wcount[i-1]
        R = rcount[i]
    tmp = max(W, R)
    if tmp < ans:
        ans = tmp
print(ans) n = int(input()) n int(input()) int input() input c = list(input()) c list(input()) list input() input wcount = [0] * n wcount [0] * n [0] 0 n rcount = [0] * n rcount [0] * n [0] 0 n for i in range(n):
    if c[i] == 'W':
        wcount[i] = 1
    if c[-(i+1)] == 'R':
        rcount[-(i+1)] = 1
    if i != 0:
        wcount[i] = wcount[i] + wcount[i-1]
        rcount[-(i+1)] = rcount[-(i+1)] + rcount[-i] i range(n) range n if c[i] == 'W':
        wcount[i] = 1
     c[i] == 'W' c[i] c i 'W' wcount[i] = 1 wcount[i] wcount i 1 if c[-(i+1)] == 'R':
        rcount[-(i+1)] = 1
     c[-(i+1)] == 'R' c[-(i+1)] c -(i+1) i+1 i 1 'R' rcount[-(i+1)] = 1 rcount[-(i+1)] rcount -(i+1) i+1 i 1 1 if i != 0:
        wcount[i] = wcount[i] + wcount[i-1]
        rcount[-(i+1)] = rcount[-(i+1)] + rcount[-i] i != 0 i 0 wcount[i] = wcount[i] + wcount[i-1] wcount[i] wcount i wcount[i] + wcount[i-1] wcount[i] wcount i wcount[i-1] wcount i-1 i 1 rcount[-(i+1)] = rcount[-(i+1)] + rcount[-i] rcount[-(i+1)] rcount -(i+1) i+1 i 1 rcount[-(i+1)] + rcount[-i] rcount[-(i+1)] rcount -(i+1) i+1 i 1 rcount[-i] rcount -i i ans = n ans n for i in range(n+1):
    if i == 0:
        W = 0
        R = rcount[0]
    elif i == n:
        W = wcount[-1]
        R = 0
    else:
        W = wcount[i-1]
        R = rcount[i]
    tmp = max(W, R)
    if tmp < ans:
        ans = tmp i range(n+1) range n+1 n 1 if i == 0:
        W = 0
        R = rcount[0]
    elif i == n:
        W = wcount[-1]
        R = 0
    else:
        W = wcount[i-1]
        R = rcount[i]
     i == 0 i 0 W = 0 W 0 R = rcount[0] R rcount[0] rcount 0 elif i == n:
        W = wcount[-1]
        R = 0
     i == n i n W = wcount[-1] W wcount[-1] wcount -1 R = 0 R 0 W = wcount[i-1] W wcount[i-1] wcount i-1 i 1 R = rcount[i] R rcount[i] rcount i tmp = max(W, R) tmp max(W, R) max W R if tmp < ans:
        ans = tmp tmp < ans tmp ans ans = tmp ans tmp print(ans) print ans c = list(input()) list(input()) c n = int(input()) int(input()) n ans = tmp tmp ans wcount = [0] * n [0] * n wcount R = 0 0 R R = rcount[i] rcount[i] R W = 0 0 W tmp = max(W, R) max(W, R) tmp W = wcount[-1] wcount[-1] W ans = n n ans R = rcount[0] rcount[0] R W = wcount[i-1] wcount[i-1] W rcount = [0] * n [0] * n rcount
n = int(input())
c = list(input())
wcount = [0] * n
rcount = [0] * n
for i in range(n):
    if c[i] == 'W':
        wcount[i] = 1
    if c[-(i+1)] == 'R':
        rcount[-(i+1)] = 1
    if i != 0:
        wcount[i] = wcount[i] + wcount[i-1]
        rcount[-(i+1)] = rcount[-(i+1)] + rcount[-i]
ans = n
for i in range(n+1):
    if i == 0:
        W = 0
        R = rcount[0]
    elif i == n:
        W = wcount[-1]
        R = 0
    else:
        W = wcount[i-1]
        R = rcount[i]
    tmp = max(W, R)
    if tmp < ans:
        ans = tmp
print(ans)