n = int(input())
c = input()
r_count = c.count('R')
ans = 0

if r_count == 0:
    print(0)
    exit()

for ci in c:
    if ci == 'W':
        ans += 1
    r_count -= 1
    if r_count == 0:
        print(ans)
        exit()
print(ans)         n = int(input()) n int(input()) int input() input c = input() c input() input r_count = c.count('R') r_count c.count('R') c.count c count 'R' ans = 0 ans 0 if r_count == 0:
    print(0)
    exit() r_count == 0 r_count 0 print(0) print 0 exit() exit for ci in c:
    if ci == 'W':
        ans += 1
    r_count -= 1
    if r_count == 0:
        print(ans)
        exit() ci c if ci == 'W':
        ans += 1
     ci == 'W' ci 'W' ans += 1 ans 1 r_count -= 1 r_count 1 if r_count == 0:
        print(ans)
        exit() r_count == 0 r_count 0 print(ans) print ans exit() exit print(ans) print ans r_count = c.count('R') c.count('R') r_count ans = 0 0 ans ans += 1 1 ans r_count -= 1 1 r_count n = int(input()) int(input()) n c = input() input() c
n = int(input())
c = input()
r_count = c.count('R')
ans = 0

if r_count == 0:
    print(0)
    exit()

for ci in c:
    if ci == 'W':
        ans += 1
    r_count -= 1
    if r_count == 0:
        print(ans)
        exit()
print(ans)        