#include<bits/stdc++.h>
using namespace std;
int main(){long n,x=0;cin>>n;vector<int>a(n,0);
           for(long i=0;i<n;i++){char c;cin>>c;
if(c=='W'){a.at(i)=1;x++;}}
           long y=n-x,p=0;
for(long i=0;i<y;i++)p+=a.at(i);
           cout<<p<<endl;}