N = int(input())
S = input()
Answer = 0
White = 0
Red = S.count('R')
for j in range(len(S)):
    i = S[j]
    if i == 'W':
        White += 1
    elif i == 'R' and White >0 and j+1 > Red:
        Answer += 1
        White -= 1
print(Answer) N = int(input()) N int(input()) int input() input S = input() S input() input Answer = 0 Answer 0 White = 0 White 0 Red = S.count('R') Red S.count('R') S.count S count 'R' for j in range(len(S)):
    i = S[j]
    if i == 'W':
        White += 1
    elif i == 'R' and White >0 and j+1 > Red:
        Answer += 1
        White -= 1 j range(len(S)) range len(S) len S i = S[j] i S[j] S j if i == 'W':
        White += 1
    elif i == 'R' and White >0 and j+1 > Red:
        Answer += 1
        White -= 1 i == 'W' i 'W' White += 1 White 1 elif i == 'R' and White >0 and j+1 > Red:
        Answer += 1
        White -= 1 i == 'R' and White >0 and j+1 > Red i == 'R' and White >0 i == 'R' i 'R' White >0 White 0 j+1 > Red j+1 j 1 Red Answer += 1 Answer 1 White -= 1 White 1 print(Answer) print Answer S = input() input() S White = 0 0 White White -= 1 1 White Red = S.count('R') S.count('R') Red White += 1 1 White Answer = 0 0 Answer Answer += 1 1 Answer N = int(input()) int(input()) N i = S[j] S[j] i
N = int(input())
S = input()
Answer = 0
White = 0
Red = S.count('R')
for j in range(len(S)):
    i = S[j]
    if i == 'W':
        White += 1
    elif i == 'R' and White >0 and j+1 > Red:
        Answer += 1
        White -= 1
print(Answer)