import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

n = int(input())
seq = input()
r = seq.count('R')
ans = 0
if r != n and r != 0:
    cnt = 0
    for i in xrange(n):
        if seq[i] == 'R':
            cnt += 1
        else:
            ans += 1
            cnt += 1
        if cnt == r:
            break
print(ans) import os os import sys sys from atexit import register from io import BytesIO sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size)) sys.stdin sys stdin BytesIO(os.read(0, os.fstat(0).st_size)) BytesIO os.read(0, os.fstat(0).st_size) os.read os read 0 os.fstat(0).st_size os.fstat(0) os.fstat os fstat 0 st_size sys.stdout = BytesIO() sys.stdout sys stdout BytesIO() BytesIO register(lambda: os.write(1, sys.stdout.getvalue())) register lambda: os.write(1, sys.stdout.getvalue()) os.write(1, sys.stdout.getvalue()) os.write os write 1 sys.stdout.getvalue() sys.stdout.getvalue sys.stdout sys stdout getvalue input = lambda: sys.stdin.readline().rstrip('\r\n') input lambda: sys.stdin.readline().rstrip('\r\n') sys.stdin.readline().rstrip('\r\n') sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip '\r\n' raw_input = lambda: sys.stdin.readline().rstrip('\r\n') raw_input lambda: sys.stdin.readline().rstrip('\r\n') sys.stdin.readline().rstrip('\r\n') sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip '\r\n' n = int(input()) n int(input()) int input() input seq = input() seq input() input r = seq.count('R') r seq.count('R') seq.count seq count 'R' ans = 0 ans 0 if r != n and r != 0:
    cnt = 0
    for i in xrange(n):
        if seq[i] == 'R':
            cnt += 1
        else:
            ans += 1
            cnt += 1
        if cnt == r:
            break r != n and r != 0 r != n r n r != 0 r 0 cnt = 0 cnt 0 for i in xrange(n):
        if seq[i] == 'R':
            cnt += 1
        else:
            ans += 1
            cnt += 1
        if cnt == r:
            break i xrange(n) xrange n if seq[i] == 'R':
            cnt += 1
        else:
            ans += 1
            cnt += 1
         seq[i] == 'R' seq[i] seq i 'R' cnt += 1 cnt 1 ans += 1 ans 1 cnt += 1 cnt 1 if cnt == r:
            break cnt == r cnt r break print(ans) print ans n = int(input()) int(input()) n input = lambda: sys.stdin.readline().rstrip('\r\n') lambda: sys.stdin.readline().rstrip('\r\n') input ans = 0 0 ans r = seq.count('R') seq.count('R') r cnt = 0 0 cnt cnt += 1 1 cnt cnt += 1 1 cnt raw_input = lambda: sys.stdin.readline().rstrip('\r\n') lambda: sys.stdin.readline().rstrip('\r\n') raw_input seq = input() input() seq ans += 1 1 ans
import os
import sys
from atexit import register
from io import BytesIO
sys.stdin = BytesIO(os.read(0, os.fstat(0).st_size))
sys.stdout = BytesIO()
register(lambda: os.write(1, sys.stdout.getvalue()))
input = lambda: sys.stdin.readline().rstrip('\r\n')
raw_input = lambda: sys.stdin.readline().rstrip('\r\n')

n = int(input())
seq = input()
r = seq.count('R')
ans = 0
if r != n and r != 0:
    cnt = 0
    for i in xrange(n):
        if seq[i] == 'R':
            cnt += 1
        else:
            ans += 1
            cnt += 1
        if cnt == r:
            break
print(ans)