# import itertools
# import math
import sys
# sys.setrecursionlimit(500*500)
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# X, K, D = map(int, input().split())
# A = list(map(int, input().split()))
# C = list(map(int, input().split()))
# tree = [[] for _ in range(N + 1)]
# B_C = [list(map(int,input().split())) for _ in range(M)]
C = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + l[1]
#             dfs(tree, l[0])
# dfs(tree, 1)


a = C.count("R")
b = C[:a].count("R")
print(a - b) import sys sys N = int(input()) N int(input()) int input() input C = input() C input() input a = C.count("R") a C.count("R") C.count C count "R" b = C[:a].count("R") b C[:a].count("R") [:a].count [:a] C :a a count "R" print(a - b) print a - b a b b = C[:a].count("R") C[:a].count("R") b C = input() input() C N = int(input()) int(input()) N a = C.count("R") C.count("R") a
# import itertools
# import math
import sys
# sys.setrecursionlimit(500*500)
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# X, K, D = map(int, input().split())
# A = list(map(int, input().split()))
# C = list(map(int, input().split()))
# tree = [[] for _ in range(N + 1)]
# B_C = [list(map(int,input().split())) for _ in range(M)]
C = input()

# B_C = sorted(B_C, reverse=True, key=lambda x:x[1])
# all_cases = list(itertools.permutations(P))
# a = list(itertools.combinations_with_replacement(range(1, M + 1), N))
# itertools.product((0,1), repeat=n)

# A = np.array(A)
# cum_A = np.cumsum(A)
# cum_A = np.insert(cum_A, 0, 0)

# def dfs(tree, s):
#     for l in tree[s]:
#         if depth[l[0]] == -1:
#             depth[l[0]] = depth[s] + l[1]
#             dfs(tree, l[0])
# dfs(tree, 1)


a = C.count("R")
b = C[:a].count("R")
print(a - b)