n = int(input())
cl = input()

if cl[:cl.count('R')].count('W') != 0:
    print(min(cl[:cl.count('R')].count('W'), cl.count('R')))
else:
    print(0) n = int(input()) n int(input()) int input() input cl = input() cl input() input if cl[:cl.count('R')].count('W') != 0:
    print(min(cl[:cl.count('R')].count('W'), cl.count('R')))
else:
    print(0) cl[:cl.count('R')].count('W') != 0 cl[:cl.count('R')].count('W') [:cl.count('R')].count [:cl.count('R')] cl :cl.count('R') cl.count('R') cl.count cl count 'R' count 'W' 0 print(min(cl[:cl.count('R')].count('W'), cl.count('R'))) print min(cl[:cl.count('R')].count('W'), cl.count('R')) min cl[:cl.count('R')].count('W') [:cl.count('R')].count [:cl.count('R')] cl :cl.count('R') cl.count('R') cl.count cl count 'R' count 'W' cl.count('R') cl.count cl count 'R' print(0) print 0 n = int(input()) int(input()) n cl = input() input() cl
n = int(input())
cl = input()

if cl[:cl.count('R')].count('W') != 0:
    print(min(cl[:cl.count('R')].count('W'), cl.count('R')))
else:
    print(0)