#include<bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  string T=S;
  sort(T.begin(),T.end());
  int count=0;
  for(int i=0;i<N;i++){
    if(S.at(i)!=T.at(i)){
      count++;
    }
  }
  cout << count/2 << endl;
}