N=int(input())
C=input()
s=0
e=N-1
ans=0
while(s<e):
  while(C[s]=="R" and s<e):
    s+=1
  while(C[e]=="W" and s<e):
    e-=1
  if s<e:
    s+=1
    e-=1
    ans+=1
print(ans) N=int(input()) N int(input()) int input() input C=input() C input() input s=0 s 0 e=N-1 e N-1 N 1 ans=0 ans 0 while(s<e):
  while(C[s]=="R" and s<e):
    s+=1
  while(C[e]=="W" and s<e):
    e-=1
  if s<e:
    s+=1
    e-=1
    ans+=1 s<e s e while(C[s]=="R" and s<e):
    s+=1
   C[s]=="R" and s<e C[s]=="R" C[s] C s "R" s<e s e s+=1 s 1 while(C[e]=="W" and s<e):
    e-=1
   C[e]=="W" and s<e C[e]=="W" C[e] C e "W" s<e s e e-=1 e 1 if s<e:
    s+=1
    e-=1
    ans+=1 s<e s e s+=1 s 1 e-=1 e 1 ans+=1 ans 1 print(ans) print ans e=N-1 N-1 e e-=1 1 e s+=1 1 s s+=1 1 s N=int(input()) int(input()) N s=0 0 s ans+=1 1 ans ans=0 0 ans e-=1 1 e C=input() input() C
N=int(input())
C=input()
s=0
e=N-1
ans=0
while(s<e):
  while(C[s]=="R" and s<e):
    s+=1
  while(C[e]=="W" and s<e):
    e-=1
  if s<e:
    s+=1
    e-=1
    ans+=1
print(ans)