N=int(input())
ls=list(input())
left=0
right=N-1
count=0
while True:
  while left<N and ls[left]=='R':
    left+=1
  while right>0 and ls[right]=='W':
    right-=1
  if left>=right:
    break
  left+=1
  right-=1
  count+=1
print(count) N=int(input()) N int(input()) int input() input ls=list(input()) ls list(input()) list input() input left=0 left 0 right=N-1 right N-1 N 1 count=0 count 0 while True:
  while left<N and ls[left]=='R':
    left+=1
  while right>0 and ls[right]=='W':
    right-=1
  if left>=right:
    break
  left+=1
  right-=1
  count+=1 True while left<N and ls[left]=='R':
    left+=1
   left<N and ls[left]=='R' left<N left N ls[left]=='R' ls[left] ls left 'R' left+=1 left 1 while right>0 and ls[right]=='W':
    right-=1
   right>0 and ls[right]=='W' right>0 right 0 ls[right]=='W' ls[right] ls right 'W' right-=1 right 1 if left>=right:
    break
   left>=right left right break left+=1 left 1 right-=1 right 1 count+=1 count 1 print(count) print count N=int(input()) int(input()) N right-=1 1 right count=0 0 count left+=1 1 left ls=list(input()) list(input()) ls left=0 0 left right=N-1 N-1 right count+=1 1 count right-=1 1 right left+=1 1 left
N=int(input())
ls=list(input())
left=0
right=N-1
count=0
while True:
  while left<N and ls[left]=='R':
    left+=1
  while right>0 and ls[right]=='W':
    right-=1
  if left>=right:
    break
  left+=1
  right-=1
  count+=1
print(count)