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

#define ll long long
#define For(i,a,b) for(int (i)=(a);(i) < (b); ++(i))

const int N =100;
set<int>* segment;

// Build the segment tree
// i denotes current node, s denotes start and
// e denotes the end of range for current node
void build(int i, int s, int e, int arr[])
{

    // If start is equal to end then
    // insert the array element
    if (s == e) {
        segment[i].insert(arr[s]);
        return;
    }

    // Else divide the range into two halves
    // (start to mid) and (mid+1 to end)
    // first half will be the left node
    // and the second half will be the right node
    build(2 * i, s, (s + e) / 2, arr);
    build(1 + 2 * i, 1 + (s + e) / 2, e, arr);

    // Insert the sets of right and left
    // node of the segment tree
    segment[i].insert(segment[2 * i].begin(),
                      segment[2 * i].end());

    segment[i].insert(segment[2 * i + 1].begin(),
                      segment[2 * i + 1].end());
}

// Query in an range a to b
set<int> query(int node, int l, int r, int a, int b)
{
    set<int> left, right, result;

    // If the range is out of the bounds
    // of this segment
    if (b < l || a > r)
        return result;

    // If the range lies in this segment
    if (a <= l && r <= b)
        return segment[node];

    // Else query for the right and left
    // leaf node of this subtree
    // and insert them into the set
    left = query(2 * node, l, (l + r) / 2, a, b);
    result.insert(left.begin(), left.end());

    right = query(1 + 2 * node, 1 + (l + r) / 2, r, a, b);
    result.insert(right.begin(), right.end());

    // Return the result
    return result;
}

// Initialize the segment tree
void init(int n)
{
    // Get the height of the segment tree
    int h = (int)ceil(log2(n));
    h = (2 * (pow(2, h))) - 1;

    // Initialize the segment tree
    segment = new set<int>[h];
}

// Function to get the result for the
// subarray from arr[l] to arr[r]
void getDistinct(int l, int r, int n)
{
    // Query for the range set
    set<int> ans = query(1, 0, n - 1, l, r);

    cout << ans.size() << endl;
}
bool isprime(int n)
{
    if (n <= 1)
        return false;
    for (int i = 2; i*i<=n; i++)
        if (n % i == 0)
            return false;

    return true;
}
int binarySearch(int arr[], int l, int r, int x)
{
    if (r >= l) {
        int mid = l + (r - l) / 2;
        if (arr[mid] == x)
            return mid;
        if (arr[mid] > x)
            return binarySearch(arr, l, mid - 1, x);
        return binarySearch(arr, mid + 1, r, x);
    }
    return -1;
}
long long lcm(long long a,long long b)
{
    long long p,r;
    p = a*b;
    r = __gcd(a, b);
    return p/r;
}
bool ispalindrome(string s)
{
    int n = s.length();
    for(int i=0;i<n/2;i++)
    {
        if(s[i]!=s[n-i-1])
            return false;
    }
    return true;
}
bool isPerfectSquare(long double x)
{
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);

}
ll f(ll n) {
	return n * (n - 1) / 2;
}
bool cmp(const tuple<int, string, string>& a,
               const tuple<int, string, string>& b)
{
    return (get<0>(a) < get<0>(b));
}
void solve()
{
    int n,r=0,w=0,ans=0;
    string s,temp="";
    cin>>n>>s;
    for(int i=0;i<n;i++)
    {
        if(s[i]=='R')
            r++;
        else
            w++;
    }
    for(int i=0;i<r;i++)
    {
        temp+='R';
    }
    for(int i=0;i<w;i++)
    {
        temp+='W';
    }
    for(int i=0;i<r;i++)
    {
        if(s[i]!=temp[i])
            ans++;
    }
    cout<<ans<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 3912