n = int(input())
# cs = ['W' for i in range(200000)]
cs = input()

w_count = 0
for c in cs:
    if c == 'W':
        w_count += 1

if w_count == 0:
    print(0)
    exit()

rest = cs[-w_count:]

answer = 0
for c in rest:
    if c == 'R':
        answer += 1
print(answer) n = int(input()) n int(input()) int input() input cs = input() cs input() input w_count = 0 w_count 0 for c in cs:
    if c == 'W':
        w_count += 1 c cs if c == 'W':
        w_count += 1 c == 'W' c 'W' w_count += 1 w_count 1 if w_count == 0:
    print(0)
    exit() w_count == 0 w_count 0 print(0) print 0 exit() exit rest = cs[-w_count:] rest cs[-w_count:] cs -w_count: -w_count w_count answer = 0 answer 0 for c in rest:
    if c == 'R':
        answer += 1 c rest if c == 'R':
        answer += 1 c == 'R' c 'R' answer += 1 answer 1 print(answer) print answer n = int(input()) int(input()) n w_count = 0 0 w_count rest = cs[-w_count:] cs[-w_count:] rest answer = 0 0 answer answer += 1 1 answer w_count += 1 1 w_count cs = input() input() cs
n = int(input())
# cs = ['W' for i in range(200000)]
cs = input()

w_count = 0
for c in cs:
    if c == 'W':
        w_count += 1

if w_count == 0:
    print(0)
    exit()

rest = cs[-w_count:]

answer = 0
for c in rest:
    if c == 'R':
        answer += 1
print(answer)
