import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
C = input()

r_cnt = C.count('R')
ans = r_cnt - C[:r_cnt].count('R')
print(ans) import sys sys sys.setrecursionlimit(300000) sys.setrecursionlimit sys setrecursionlimit 300000 def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) MI def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) MI0 def LMI(): return list(map(int, sys.stdin.readline().split())) LMI def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) LMI0 MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('inf') INF float('inf') float 'inf' N = I() N I() I C = input() C input() input r_cnt = C.count('R') r_cnt C.count('R') C.count C count 'R' ans = r_cnt - C[:r_cnt].count('R') ans r_cnt - C[:r_cnt].count('R') r_cnt C[:r_cnt].count('R') [:r_cnt].count [:r_cnt] C :r_cnt r_cnt count 'R' print(ans) print ans def I(): return int(sys.stdin.readline()) def I(): return int(sys.stdin.readline()) I def MI(): return map(int, sys.stdin.readline().split()) def MI(): return map(int, sys.stdin.readline().split()) MI def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split())) LMI0 ans = r_cnt - C[:r_cnt].count('R') r_cnt - C[:r_cnt].count('R') ans MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD N = I() I() N r_cnt = C.count('R') C.count('R') r_cnt def LMI(): return list(map(int, sys.stdin.readline().split())) def LMI(): return list(map(int, sys.stdin.readline().split())) LMI C = input() input() C def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split()) MI0 INF = float('inf') float('inf') INF
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def MI0(): return map(lambda s: int(s) - 1, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
def LMI0(): return list(map(lambda s: int(s) - 1, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


N = I()
C = input()

r_cnt = C.count('R')
ans = r_cnt - C[:r_cnt].count('R')
print(ans)