n = gets.to_i
chars = gets.chars
w_cnt = 0

(n / 2).times do |_|
    c = chars.shift
    if chars.include?("R")
        if c == "W"
            w_cnt += 1
        end            
    end
end
puts w_cnt

