import bisect

N = int(input())
c = list(input())
c_sorted = sorted(c)

R_count = bisect.bisect_right(c_sorted, 'R')
ans = 0
for i in range(R_count):
    if c[i] != 'R':
        ans += 1
print(ans) import bisect bisect N = int(input()) N int(input()) int input() input c = list(input()) c list(input()) list input() input c_sorted = sorted(c) c_sorted sorted(c) sorted c R_count = bisect.bisect_right(c_sorted, 'R') R_count bisect.bisect_right(c_sorted, 'R') bisect.bisect_right bisect bisect_right c_sorted 'R' ans = 0 ans 0 for i in range(R_count):
    if c[i] != 'R':
        ans += 1 i range(R_count) range R_count if c[i] != 'R':
        ans += 1 c[i] != 'R' c[i] c i 'R' ans += 1 ans 1 print(ans) print ans c = list(input()) list(input()) c ans += 1 1 ans ans = 0 0 ans R_count = bisect.bisect_right(c_sorted, 'R') bisect.bisect_right(c_sorted, 'R') R_count c_sorted = sorted(c) sorted(c) c_sorted N = int(input()) int(input()) N
import bisect

N = int(input())
c = list(input())
c_sorted = sorted(c)

R_count = bisect.bisect_right(c_sorted, 'R')
ans = 0
for i in range(R_count):
    if c[i] != 'R':
        ans += 1
print(ans)