#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n,count,ans;cin >> n;
  count=ans=0;
  string s;cin >> s;
  for (int i=0;i<n;i++) {
    if (s[i]=='R') count++;
  }
  for (int i=0;i<count;i++) {
    if (s[i]=='W') ans++;
  }
  cout << ans << endl;
}