N = int(input())
S = input()
i = 0
j = N - 1
ans = 0
while i < j:
    while i < N and S[i] == 'R':
        i += 1
    while j > 0 and S[j] == 'W':
        j -= 1
    if i >= j:
        break
    ans += 1
    i += 1
    j -= 1
print(ans) N = int(input()) N int(input()) int input() input S = input() S input() input i = 0 i 0 j = N - 1 j N - 1 N 1 ans = 0 ans 0 while i < j:
    while i < N and S[i] == 'R':
        i += 1
    while j > 0 and S[j] == 'W':
        j -= 1
    if i >= j:
        break
    ans += 1
    i += 1
    j -= 1 i < j i j while i < N and S[i] == 'R':
        i += 1
     i < N and S[i] == 'R' i < N i N S[i] == 'R' S[i] S i 'R' i += 1 i 1 while j > 0 and S[j] == 'W':
        j -= 1
     j > 0 and S[j] == 'W' j > 0 j 0 S[j] == 'W' S[j] S j 'W' j -= 1 j 1 if i >= j:
        break
     i >= j i j break ans += 1 ans 1 i += 1 i 1 j -= 1 j 1 print(ans) print ans N = int(input()) int(input()) N i += 1 1 i i += 1 1 i S = input() input() S i = 0 0 i j -= 1 1 j ans += 1 1 ans ans = 0 0 ans j = N - 1 N - 1 j j -= 1 1 j
N = int(input())
S = input()
i = 0
j = N - 1
ans = 0
while i < j:
    while i < N and S[i] == 'R':
        i += 1
    while j > 0 and S[j] == 'W':
        j -= 1
    if i >= j:
        break
    ans += 1
    i += 1
    j -= 1
print(ans)
