Imports System

Module Program
    Sub Main(args As String())

        Dim N As Integer = Integer.Parse(Console.ReadLine())
        Dim c As String = Console.ReadLine()
        Dim r As Integer = 0
        Dim w As Integer = 0
        Dim bw As Integer = 0
        Dim ar As Integer = 0
        Dim ans As Integer = 0

        For i As Integer = 0 To N - 1
            If c(i) = "R" Then
                r += 1
            Else
                w += 1
            End If
            If i < N \ 2 Then
                If c(i) = "W" Then
                    bw += 1
                End If
            Else
                If c(i) = "R" Then

                    ar += 1
                End If
            End If
        Next

        If r = 0 Or w = 0 Then
            ans = 0
        Else
            If bw > ar Then
                ans = ar
            Else
                ans = bw
            End If
        End If

        Console.WriteLine(ans)

    End Sub
End Module
