n = int(input())
c = input()
count = 0

i, j = 0, n - 1
if c.count('W') == 0:
    count=0
elif c.count('R') == 0:
    count = 0
else:
    white_cnt = []
    red_cnt = []
    for i in range(n):
        if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
    while 1:
        white_num = white_cnt.pop(0)
        red_num = red_cnt.pop()
        if white_num < red_num:
            count += 1
        if len(white_cnt) == 0:
            break
        if len(red_cnt) == 0:
            break
print(count) n = int(input()) n int(input()) int input() input c = input() c input() input count = 0 count 0 i, j = 0, n - 1 i 0 j n - 1 n 1 if c.count('W') == 0:
    count=0
elif c.count('R') == 0:
    count = 0
else:
    white_cnt = []
    red_cnt = []
    for i in range(n):
        if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
    while 1:
        white_num = white_cnt.pop(0)
        red_num = red_cnt.pop()
        if white_num < red_num:
            count += 1
        if len(white_cnt) == 0:
            break
        if len(red_cnt) == 0:
            break c.count('W') == 0 c.count('W') c.count c count 'W' 0 count=0 count 0 elif c.count('R') == 0:
    count = 0 c.count('R') == 0 c.count('R') c.count c count 'R' 0 count = 0 count 0 white_cnt = [] white_cnt [] red_cnt = [] red_cnt [] for i in range(n):
        if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
     i range(n) range n if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
     c[i] == 'W' c[i] c i 'W' white_cnt.append(i) white_cnt.append white_cnt append i red_cnt.append(i) red_cnt.append red_cnt append i while 1:
        white_num = white_cnt.pop(0)
        red_num = red_cnt.pop()
        if white_num < red_num:
            count += 1
        if len(white_cnt) == 0:
            break
        if len(red_cnt) == 0:
            break 1 white_num = white_cnt.pop(0) white_num white_cnt.pop(0) white_cnt.pop white_cnt pop 0 red_num = red_cnt.pop() red_num red_cnt.pop() red_cnt.pop red_cnt pop if white_num < red_num:
            count += 1
         white_num < red_num white_num red_num count += 1 count 1 if len(white_cnt) == 0:
            break
         len(white_cnt) == 0 len(white_cnt) len white_cnt 0 break if len(red_cnt) == 0:
            break len(red_cnt) == 0 len(red_cnt) len red_cnt 0 break print(count) print count count = 0 0 count j = 0, n - 1 n - 1 j i, j = 0, n - 1 0 i white_num = white_cnt.pop(0) white_cnt.pop(0) white_num n = int(input()) int(input()) n count += 1 1 count red_cnt = [] [] red_cnt c = input() input() c red_num = red_cnt.pop() red_cnt.pop() red_num count = 0 0 count count=0 0 count white_cnt = [] [] white_cnt
n = int(input())
c = input()
count = 0

i, j = 0, n - 1
if c.count('W') == 0:
    count=0
elif c.count('R') == 0:
    count = 0
else:
    white_cnt = []
    red_cnt = []
    for i in range(n):
        if c[i] == 'W':
            white_cnt.append(i)
        else:
            red_cnt.append(i)
    while 1:
        white_num = white_cnt.pop(0)
        red_num = red_cnt.pop()
        if white_num < red_num:
            count += 1
        if len(white_cnt) == 0:
            break
        if len(red_cnt) == 0:
            break
print(count)
