import sys

input = sys.stdin.readline

 

n = int(eval(input()))

c = eval(input())

r = c.count("R")

w = c.count("W")

s = c[:r]

s = s.count("W")

print((min(w, s)))
import sys

input = sys.stdin.readline

 

n = int(eval(input()))

c = eval(input())

r = c.count("R")

w = c.count("W")

s = c[:r]

s = s.count("W")

print(s)
import sys

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

import sys

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

-print((min(w, s))) +print(s)