n=int(input())
s=input()
w=s.count('W')
r=s.count('R')

ans=10**9
if w==0 or r==0:
  print(0)
  exit(0)

left_white, right_red=0,r
for i in range(n):
  if s[i]=='W':
    left_white+=1
  else:
    right_red-=1
  ans=min(ans,max(left_white,right_red))
  
print(ans) n=int(input()) n int(input()) int input() input s=input() s input() input w=s.count('W') w s.count('W') s.count s count 'W' r=s.count('R') r s.count('R') s.count s count 'R' ans=10**9 ans 10**9 10 9 if w==0 or r==0:
  print(0)
  exit(0) w==0 or r==0 w==0 w 0 r==0 r 0 print(0) print 0 exit(0) exit 0 left_white, right_red=0,r left_white 0 right_red r for i in range(n):
  if s[i]=='W':
    left_white+=1
  else:
    right_red-=1
  ans=min(ans,max(left_white,right_red))
   i range(n) range n if s[i]=='W':
    left_white+=1
  else:
    right_red-=1
   s[i]=='W' s[i] s i 'W' left_white+=1 left_white 1 right_red-=1 right_red 1 ans=min(ans,max(left_white,right_red)) ans min(ans,max(left_white,right_red)) min ans max(left_white,right_red) max left_white right_red print(ans) print ans left_white, right_red=0,r 0 left_white right_red=0,r r right_red ans=min(ans,max(left_white,right_red)) min(ans,max(left_white,right_red)) ans r=s.count('R') s.count('R') r ans=10**9 10**9 ans n=int(input()) int(input()) n w=s.count('W') s.count('W') w s=input() input() s right_red-=1 1 right_red left_white+=1 1 left_white
n=int(input())
s=input()
w=s.count('W')
r=s.count('R')

ans=10**9
if w==0 or r==0:
  print(0)
  exit(0)

left_white, right_red=0,r
for i in range(n):
  if s[i]=='W':
    left_white+=1
  else:
    right_red-=1
  ans=min(ans,max(left_white,right_red))
  
print(ans)