n=int(input())
s=input()
A=[]
for i in range(n):
  A.append(s[i])
W=0
R=A.count('R')
ans=float('inf')
for i in range(n+1):
  if i!=0:
    if A[i-1]=='W':
      W+=1
    else:
      R-=1
  ans=min(max(W,R),ans)
print(ans) n=int(input()) n int(input()) int input() input s=input() s input() input A=[] A [] for i in range(n):
  A.append(s[i]) i range(n) range n A.append(s[i]) A.append A append s[i] s i W=0 W 0 R=A.count('R') R A.count('R') A.count A count 'R' ans=float('inf') ans float('inf') float 'inf' for i in range(n+1):
  if i!=0:
    if A[i-1]=='W':
      W+=1
    else:
      R-=1
  ans=min(max(W,R),ans) i range(n+1) range n+1 n 1 if i!=0:
    if A[i-1]=='W':
      W+=1
    else:
      R-=1
   i!=0 i 0 if A[i-1]=='W':
      W+=1
    else:
      R-=1
   A[i-1]=='W' A[i-1] A i-1 i 1 'W' W+=1 W 1 R-=1 R 1 ans=min(max(W,R),ans) ans min(max(W,R),ans) min max(W,R) max W R ans print(ans) print ans n=int(input()) int(input()) n A=[] [] A ans=min(max(W,R),ans) min(max(W,R),ans) ans W=0 0 W R=A.count('R') A.count('R') R ans=float('inf') float('inf') ans s=input() input() s W+=1 1 W R-=1 1 R
n=int(input())
s=input()
A=[]
for i in range(n):
  A.append(s[i])
W=0
R=A.count('R')
ans=float('inf')
for i in range(n+1):
  if i!=0:
    if A[i-1]=='W':
      W+=1
    else:
      R-=1
  ans=min(max(W,R),ans)
print(ans)