N = int(input())
c = list(input())


l1 = list()
for i in range(N):
    if c[i] == 'R':
        l1.append(i)
        


num = 0

def swap(i, j):
    a = c[i]
    c[i] = c[j]
    c[j] = a
    return

if len(l1) >= 1:
    for i in range(N):
        if i > l1[-1]:
            break
        if c[i] == 'W':
             swap(i, l1.pop(-1))
             num += 1
        if len(l1) == 0:
            break
print(num) N = int(input()) N int(input()) int input() input c = list(input()) c list(input()) list input() input l1 = list() l1 list() list for i in range(N):
    if c[i] == 'R':
        l1.append(i)
         i range(N) range N if c[i] == 'R':
        l1.append(i)
         c[i] == 'R' c[i] c i 'R' l1.append(i) l1.append l1 append i num = 0 num 0 def swap(i, j):
    a = c[i]
    c[i] = c[j]
    c[j] = a
    return swap a = c[i] a c[i] c i c[i] = c[j] c[i] c i c[j] c j c[j] = a c[j] c j a return i i j j if len(l1) >= 1:
    for i in range(N):
        if i > l1[-1]:
            break
        if c[i] == 'W':
             swap(i, l1.pop(-1))
             num += 1
        if len(l1) == 0:
            break len(l1) >= 1 len(l1) len l1 1 for i in range(N):
        if i > l1[-1]:
            break
        if c[i] == 'W':
             swap(i, l1.pop(-1))
             num += 1
        if len(l1) == 0:
            break i range(N) range N if i > l1[-1]:
            break
         i > l1[-1] i l1[-1] l1 -1 break if c[i] == 'W':
             swap(i, l1.pop(-1))
             num += 1
         c[i] == 'W' c[i] c i 'W' swap(i, l1.pop(-1)) swap i l1.pop(-1) l1.pop l1 pop -1 num += 1 num 1 if len(l1) == 0:
            break len(l1) == 0 len(l1) len l1 0 break print(num) print num num = 0 0 num l1 = list() list() l1 c = list(input()) list(input()) c def swap(i, j):
    a = c[i]
    c[i] = c[j]
    c[j] = a
    return def swap(i, j):
    a = c[i]
    c[i] = c[j]
    c[j] = a
    return swap num += 1 1 num N = int(input()) int(input()) N
N = int(input())
c = list(input())


l1 = list()
for i in range(N):
    if c[i] == 'R':
        l1.append(i)
        


num = 0

def swap(i, j):
    a = c[i]
    c[i] = c[j]
    c[j] = a
    return

if len(l1) >= 1:
    for i in range(N):
        if i > l1[-1]:
            break
        if c[i] == 'W':
             swap(i, l1.pop(-1))
             num += 1
        if len(l1) == 0:
            break
print(num)
