n = int(input())
c = input()
left, right = 0, n - 1
cnt = 0
while left <= right:
    while left < n and c[left] == 'R':
        left += 1
    while right > -1 and c[right] == 'W':
        right -= 1
    if left == n or right == -1 or left >= right: break
    left += 1
    right -= 1
    cnt += 1
print(cnt) n = int(input()) n int(input()) int input() input c = input() c input() input left, right = 0, n - 1 left 0 right n - 1 n 1 cnt = 0 cnt 0 while left <= right:
    while left < n and c[left] == 'R':
        left += 1
    while right > -1 and c[right] == 'W':
        right -= 1
    if left == n or right == -1 or left >= right: break
    left += 1
    right -= 1
    cnt += 1 left <= right left right while left < n and c[left] == 'R':
        left += 1
     left < n and c[left] == 'R' left < n left n c[left] == 'R' c[left] c left 'R' left += 1 left 1 while right > -1 and c[right] == 'W':
        right -= 1
     right > -1 and c[right] == 'W' right > -1 right -1 c[right] == 'W' c[right] c right 'W' right -= 1 right 1 if left == n or right == -1 or left >= right: break
     left == n or right == -1 or left >= right left == n or right == -1 left == n left n right == -1 right -1 left >= right left right left += 1 left 1 right -= 1 right 1 cnt += 1 cnt 1 print(cnt) print cnt right -= 1 1 right left, right = 0, n - 1 0 left left += 1 1 left right -= 1 1 right cnt += 1 1 cnt c = input() input() c n = int(input()) int(input()) n right = 0, n - 1 n - 1 right cnt = 0 0 cnt left += 1 1 left
n = int(input())
c = input()
left, right = 0, n - 1
cnt = 0
while left <= right:
    while left < n and c[left] == 'R':
        left += 1
    while right > -1 and c[right] == 'W':
        right -= 1
    if left == n or right == -1 or left >= right: break
    left += 1
    right -= 1
    cnt += 1
print(cnt)