n = int(input())
c = input().strip()
c = list(c)

ans = 0
low = 0
high = n-1

while low<high:
    if c[low] == 'W':
        
        while low<high and c[high]=='W':
            high -= 1
        
        if c[high] == 'R':
            ans+=1
            c[high], c[low] = c[low], c[high]
            
    low += 1    

print(ans) n = int(input()) n int(input()) int input() input c = input().strip() c input().strip() ().strip () input strip c = list(c) c list(c) list c ans = 0 ans 0 low = 0 low 0 high = n-1 high n-1 n 1 while low<high:
    if c[low] == 'W':
        
        while low<high and c[high]=='W':
            high -= 1
        
        if c[high] == 'R':
            ans+=1
            c[high], c[low] = c[low], c[high]
            
    low += 1     low<high low high if c[low] == 'W':
        
        while low<high and c[high]=='W':
            high -= 1
        
        if c[high] == 'R':
            ans+=1
            c[high], c[low] = c[low], c[high]
            
     c[low] == 'W' c[low] c low 'W' while low<high and c[high]=='W':
            high -= 1
        
         low<high and c[high]=='W' low<high low high c[high]=='W' c[high] c high 'W' high -= 1 high 1 if c[high] == 'R':
            ans+=1
            c[high], c[low] = c[low], c[high]
            
     c[high] == 'R' c[high] c high 'R' ans+=1 ans 1 c[high], c[low] = c[low], c[high] c[high] c high c[low] c low c[low] c low c[high] c high low += 1 low 1 print(ans) print ans ans+=1 1 ans high -= 1 1 high c = input().strip() input().strip() c c = list(c) list(c) c high = n-1 n-1 high ans = 0 0 ans n = int(input()) int(input()) n low += 1 1 low low = 0 0 low
n = int(input())
c = input().strip()
c = list(c)

ans = 0
low = 0
high = n-1

while low<high:
    if c[low] == 'W':
        
        while low<high and c[high]=='W':
            high -= 1
        
        if c[high] == 'R':
            ans+=1
            c[high], c[low] = c[low], c[high]
            
    low += 1    

print(ans)