# Nとcの定義
N = int(input())
C = input()

# 赤色の個数
red_num = str.count(C, "R")

# 左からred_num個までに含まれる白色の個数
white_num_left = str.count(C[:red_num], "W")

# 最小の操作回数
min_ope = white_num_left

# 最小の操作回数の出力
print(min_ope) N = int(input()) N int(input()) int input() input C = input() C input() input red_num = str.count(C, "R") red_num str.count(C, "R") str.count str count C "R" white_num_left = str.count(C[:red_num], "W") white_num_left str.count(C[:red_num], "W") str.count str count C[:red_num] C :red_num red_num "W" min_ope = white_num_left min_ope white_num_left print(min_ope) print min_ope red_num = str.count(C, "R") str.count(C, "R") red_num min_ope = white_num_left white_num_left min_ope N = int(input()) int(input()) N white_num_left = str.count(C[:red_num], "W") str.count(C[:red_num], "W") white_num_left C = input() input() C
# Nとcの定義
N = int(input())
C = input()

# 赤色の個数
red_num = str.count(C, "R")

# 左からred_num個までに含まれる白色の個数
white_num_left = str.count(C[:red_num], "W")

# 最小の操作回数
min_ope = white_num_left

# 最小の操作回数の出力
print(min_ope)