n=int(input())
c=list(input())
r=[]
w=[]
for i in range(n):
  if c[i]=='R':
    r.append(i)
  else:
    w.append(i)
r.reverse()
ans=0
for i in range(min(len(r),len(w))):
  if r[i]>w[i]:
    ans+=1
print(ans) n=int(input()) n int(input()) int input() input c=list(input()) c list(input()) list input() input r=[] r [] w=[] w [] for i in range(n):
  if c[i]=='R':
    r.append(i)
  else:
    w.append(i) i range(n) range n if c[i]=='R':
    r.append(i)
  else:
    w.append(i) c[i]=='R' c[i] c i 'R' r.append(i) r.append r append i w.append(i) w.append w append i r.reverse() r.reverse r reverse ans=0 ans 0 for i in range(min(len(r),len(w))):
  if r[i]>w[i]:
    ans+=1 i range(min(len(r),len(w))) range min(len(r),len(w)) min len(r) len r len(w) len w if r[i]>w[i]:
    ans+=1 r[i]>w[i] r[i] r i w[i] w i ans+=1 ans 1 print(ans) print ans ans+=1 1 ans ans=0 0 ans w=[] [] w r=[] [] r n=int(input()) int(input()) n c=list(input()) list(input()) c
n=int(input())
c=list(input())
r=[]
w=[]
for i in range(n):
  if c[i]=='R':
    r.append(i)
  else:
    w.append(i)
r.reverse()
ans=0
for i in range(min(len(r),len(w))):
  if r[i]>w[i]:
    ans+=1
print(ans)