#https://atcoder.jp/contests/agc008/submissions/15248942

import sys

import math



sys.setrecursionlimit(10 ** 8)

ini = lambda: int(sys.stdin.readline())

inm = lambda: map(int, sys.stdin.readline().split())

inl = lambda: list(inm())

ins = lambda: sys.stdin.readline().rstrip()

debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))



N = ini()

c = input()



R = c.count('R')

W = c.count('W')

left = c[:R]



ans = min(R,W)

ans = min(ans,left.count('W'))



print(ans)



#https://atcoder.jp/contests/agc008/submissions/15248942

import sys

import math



sys.setrecursionlimit(10 ** 8)

ini = lambda: int(sys.stdin.readline())

inm = lambda: map(int, sys.stdin.readline().split())

inl = lambda: list(inm())

ins = lambda: sys.stdin.readline().rstrip()

debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))



N = ini()

c = input()



R = c.count('R')

left = c[:R]

ans = left.count('W')



print(ans)

# https://atcoder.jp/contests/agc008/submissions/15248942
import sys
import math

sys.setrecursionlimit(10**8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))
N = ini()
c = input()
R = c.count("R")
W = c.count("W")
left = c[:R]
ans = min(R, W)
ans = min(ans, left.count("W"))
print(ans)

# https://atcoder.jp/contests/agc008/submissions/15248942
import sys
import math

sys.setrecursionlimit(10**8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))
N = ini()
c = input()
R = c.count("R")
left = c[:R]
ans = left.count("W")
print(ans)

-W = c.count("W") -ans = min(R, W) -ans = min(ans, left.count("W")) +ans = left.count("W")