N = int(input())
c = input()

R = 0
W = 0
for ci in c:
    if ci == 'R':
        R += 1

ans = max(R,W)
for ci in c:
    if ci == 'R':
        R -= 1
    else:
        W += 1
    tmp = max(R,W)
    ans = min(ans,tmp)

print(ans) N = int(input()) N int(input()) int input() input c = input() c input() input R = 0 R 0 W = 0 W 0 for ci in c:
    if ci == 'R':
        R += 1 ci c if ci == 'R':
        R += 1 ci == 'R' ci 'R' R += 1 R 1 ans = max(R,W) ans max(R,W) max R W for ci in c:
    if ci == 'R':
        R -= 1
    else:
        W += 1
    tmp = max(R,W)
    ans = min(ans,tmp) ci c if ci == 'R':
        R -= 1
    else:
        W += 1
     ci == 'R' ci 'R' R -= 1 R 1 W += 1 W 1 tmp = max(R,W) tmp max(R,W) max R W ans = min(ans,tmp) ans min(ans,tmp) min ans tmp print(ans) print ans ans = min(ans,tmp) min(ans,tmp) ans R += 1 1 R N = int(input()) int(input()) N tmp = max(R,W) max(R,W) tmp R -= 1 1 R c = input() input() c W = 0 0 W ans = max(R,W) max(R,W) ans R = 0 0 R W += 1 1 W
N = int(input())
c = input()

R = 0
W = 0
for ci in c:
    if ci == 'R':
        R += 1

ans = max(R,W)
for ci in c:
    if ci == 'R':
        R -= 1
    else:
        W += 1
    tmp = max(R,W)
    ans = min(ans,tmp)

print(ans)