import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

n = readInt()
text = readStringList()
import collections
c  = collections.Counter(text)
if c['W'] == 0:
    print("0")
    exit()
i,j,count = 0,len(text)-1,0

while i <= j and i < len(text):
    if text[i] == 'W':
        while text[j] != 'R' and j > 0:
            j -= 1
        if i <= j and j > 0:
            text[i],text[j] = text[j],text[i]
            count += 1
    i += 1
print(count)
 import sys sys sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 def input(): return sys.stdin.readline()[:-1] input mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 def readInt():return int(input()) readInt def readIntList():return list(map(int,input().split())) readIntList def readStringList():return list(input()) readStringList def readStringListWithSpace():return list(input().split()) readStringListWithSpace def readString():return input() readString n = readInt() n readInt() readInt text = readStringList() text readStringList() readStringList import collections collections c  = collections.Counter(text) c collections.Counter(text) collections.Counter collections Counter text if c['W'] == 0:
    print("0")
    exit() c['W'] == 0 c['W'] c 'W' 0 print("0") print "0" exit() exit i,j,count = 0,len(text)-1,0 i 0 j len(text)-1 len(text) len text 1 count 0 while i <= j and i < len(text):
    if text[i] == 'W':
        while text[j] != 'R' and j > 0:
            j -= 1
        if i <= j and j > 0:
            text[i],text[j] = text[j],text[i]
            count += 1
    i += 1 i <= j and i < len(text) i <= j i j i < len(text) i len(text) len text if text[i] == 'W':
        while text[j] != 'R' and j > 0:
            j -= 1
        if i <= j and j > 0:
            text[i],text[j] = text[j],text[i]
            count += 1
     text[i] == 'W' text[i] text i 'W' while text[j] != 'R' and j > 0:
            j -= 1
         text[j] != 'R' and j > 0 text[j] != 'R' text[j] text j 'R' j > 0 j 0 j -= 1 j 1 if i <= j and j > 0:
            text[i],text[j] = text[j],text[i]
            count += 1
     i <= j and j > 0 i <= j i j j > 0 j 0 text[i],text[j] = text[j],text[i] text[i] text i text[j] text j text[j] text j text[i] text i count += 1 count 1 i += 1 i 1 print(count) print count def readIntList():return list(map(int,input().split())) def readIntList():return list(map(int,input().split())) readIntList n = readInt() readInt() n text = readStringList() readStringList() text def readInt():return int(input()) def readInt():return int(input()) readInt def readStringList():return list(input()) def readStringList():return list(input()) readStringList count += 1 1 count j -= 1 1 j i,j,count = 0,len(text)-1,0 0 i i += 1 1 i mod = 10**9 + 7 10**9 + 7 mod def readStringListWithSpace():return list(input().split()) def readStringListWithSpace():return list(input().split()) readStringListWithSpace def readString():return input() def readString():return input() readString def input(): return sys.stdin.readline()[:-1] def input(): return sys.stdin.readline()[:-1] input c  = collections.Counter(text) collections.Counter(text) c count = 0,len(text)-1,0 0 count j,count = 0,len(text)-1,0 len(text)-1 j
import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

n = readInt()
text = readStringList()
import collections
c  = collections.Counter(text)
if c['W'] == 0:
    print("0")
    exit()
i,j,count = 0,len(text)-1,0

while i <= j and i < len(text):
    if text[i] == 'W':
        while text[j] != 'R' and j > 0:
            j -= 1
        if i <= j and j > 0:
            text[i],text[j] = text[j],text[i]
            count += 1
    i += 1
print(count)

