n = int(eval(input()))

ls = list(eval(input()))

r = ls.count('R')

w = ls.count('W')

if r == 0 or w == 0:

    print((0))

else:

    r_in_half = ls[:r].count('R')

    ans = r - r_in_half

    print(ans)

import sys

input = sys.stdin.readline



n = eval(input())

s = eval(input())



r = s.count('R')

print((s[:r].count('W')))

n = int(eval(input()))
ls = list(eval(input()))
r = ls.count("R")
w = ls.count("W")
if r == 0 or w == 0:
    print((0))
else:
    r_in_half = ls[:r].count("R")
    ans = r - r_in_half
    print(ans)

import sys

input = sys.stdin.readline
n = eval(input())
s = eval(input())
r = s.count("R")
print((s[:r].count("W")))

-n = int(eval(input())) -ls = list(eval(input())) -r = ls.count("R") -w = ls.count("W") -if r == 0 or w == 0: -    print((0)) -else: -    r_in_half = ls[:r].count("R") -    ans = r - r_in_half -    print(ans) +import sys + +input = sys.stdin.readline +n = eval(input()) +s = eval(input()) +r = s.count("R") +print((s[:r].count("W")))