def max(a, b); a < b ? b : a; end
def min(a, b); a < b ? a : b; end

class Problem
  attr_accessor *(?a..?z).to_a.map(&:to_sym)

  def initialize
    @n = gets.to_s.to_i
    @s = gets.chomp
  end

  def solve
    lo = 0
    hi = n - 1
    ans = 0
    while lo < hi
      if s[lo] == "R" && s[hi] == "W"
        lo += 1
        hi -= 1
      elsif s[lo] == "W" && s[hi] == "R"
        ans += 1
        lo += 1
        hi -= 1
      elsif s[lo] == "R" && s[hi] == "R"
        lo += 1
      else
        hi -= 1
      end
    end
    ans
  end

  def show(ans)
    puts ans
  end
end

Problem.new.instance_eval do
  show(solve)
end
