N = gets.to_i
S = gets.chomp
c = 0
l = 0
r = N - 1
loop{
    while S[l] == "R"
        l += 1
        break if l >= N
    end
    while S[r] == "W"
        r -= 1
        break if r < 0
    end
    break if r <= l
    c += 1
    S[l] = "R"
    S[r] = "W"
}
puts c
