#!/usr/bin/env python3

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(input())
C = input()

left = 0
right = N-1
count = 0

while left < right:
    if C[left] == 'W' and C[right] == 'R':
        count += 1
        left += 1
        right -= 1

    if C[left] == 'R':
        left += 1
    if C[right] == 'W':
        right -= 1

print(count) import sys sys read = sys.stdin.buffer.read read sys.stdin.buffer.read sys.stdin.buffer sys.stdin sys stdin buffer read readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline readlines = sys.stdin.buffer.readlines readlines sys.stdin.buffer.readlines sys.stdin.buffer sys.stdin sys stdin buffer readlines sys.setrecursionlimit(10 ** 7) sys.setrecursionlimit sys setrecursionlimit 10 ** 7 10 7 N = int(input()) N int(input()) int input() input C = input() C input() input left = 0 left 0 right = N-1 right N-1 N 1 count = 0 count 0 while left < right:
    if C[left] == 'W' and C[right] == 'R':
        count += 1
        left += 1
        right -= 1

    if C[left] == 'R':
        left += 1
    if C[right] == 'W':
        right -= 1 left < right left right if C[left] == 'W' and C[right] == 'R':
        count += 1
        left += 1
        right -= 1

     C[left] == 'W' and C[right] == 'R' C[left] == 'W' C[left] C left 'W' C[right] == 'R' C[right] C right 'R' count += 1 count 1 left += 1 left 1 right -= 1 right 1 if C[left] == 'R':
        left += 1
     C[left] == 'R' C[left] C left 'R' left += 1 left 1 if C[right] == 'W':
        right -= 1 C[right] == 'W' C[right] C right 'W' right -= 1 right 1 print(count) print count right = N-1 N-1 right left = 0 0 left left += 1 1 left readlines = sys.stdin.buffer.readlines sys.stdin.buffer.readlines readlines left += 1 1 left right -= 1 1 right count += 1 1 count read = sys.stdin.buffer.read sys.stdin.buffer.read read readline = sys.stdin.buffer.readline sys.stdin.buffer.readline readline N = int(input()) int(input()) N right -= 1 1 right C = input() input() C count = 0 0 count
#!/usr/bin/env python3

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(input())
C = input()

left = 0
right = N-1
count = 0

while left < right:
    if C[left] == 'W' and C[right] == 'R':
        count += 1
        left += 1
        right -= 1

    if C[left] == 'R':
        left += 1
    if C[right] == 'W':
        right -= 1

print(count)
