n = input()
c = input()
i = 0
while 1:
    l = c.find('W')
    r = c.rfind('R')
    if l == -1 or r == -1 or l >= r:
        break
    c = c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:]
    i += 1
print(i) n = input() n input() input c = input() c input() input i = 0 i 0 while 1:
    l = c.find('W')
    r = c.rfind('R')
    if l == -1 or r == -1 or l >= r:
        break
    c = c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:]
    i += 1 1 l = c.find('W') l c.find('W') c.find c find 'W' r = c.rfind('R') r c.rfind('R') c.rfind c rfind 'R' if l == -1 or r == -1 or l >= r:
        break
     l == -1 or r == -1 or l >= r l == -1 or r == -1 l == -1 l -1 r == -1 r -1 l >= r l r break c = c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:] c c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:] c[:l] + 'R' + c[l + 1:r] + 'W' c[:l] + 'R' + c[l + 1:r] c[:l] + 'R' c[:l] c :l l 'R' c[l + 1:r] c l + 1:r l + 1 l 1 r 'W' c[r + 1:] c r + 1: r + 1 r 1 i += 1 i 1 print(i) print i l = c.find('W') c.find('W') l c = input() input() c r = c.rfind('R') c.rfind('R') r c = c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:] c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:] c i = 0 0 i i += 1 1 i n = input() input() n
n = input()
c = input()
i = 0
while 1:
    l = c.find('W')
    r = c.rfind('R')
    if l == -1 or r == -1 or l >= r:
        break
    c = c[:l] + 'R' + c[l + 1:r] + 'W'  + c[r + 1:]
    i += 1
print(i)
