import math
from decimal import *

n = int(input())
c = str(input())
w = c.count('W')
c = c[::-1]
ans= 0
for i in range(w):
    if(c[i]!= 'W'):
        ans+=1
print(ans) import math math from decimal import * n = int(input()) n int(input()) int input() input c = str(input()) c str(input()) str input() input w = c.count('W') w c.count('W') c.count c count 'W' c = c[::-1] c c[::-1] c ::-1 -1 ans= 0 ans 0 for i in range(w):
    if(c[i]!= 'W'):
        ans+=1 i range(w) range w if(c[i]!= 'W'):
        ans+=1 c[i]!= 'W' c[i] c i 'W' ans+=1 ans 1 print(ans) print ans n = int(input()) int(input()) n ans= 0 0 ans c = str(input()) str(input()) c ans+=1 1 ans c = c[::-1] c[::-1] c w = c.count('W') c.count('W') w
import math
from decimal import *

n = int(input())
c = str(input())
w = c.count('W')
c = c[::-1]
ans= 0
for i in range(w):
    if(c[i]!= 'W'):
        ans+=1
print(ans)