#!/usr/bin/env ruby

N = gets.chomp.to_i

S = gets.chomp

i = 0

j = N - 1

ans = 0

loop do
  while S[i] == 'R' && i < j
    i += 1
  end

  break if i >= j

  while S[j] == 'W' && i < j
    j -= 1
  end

  break if i >= j

  S[i], S[j] = S[j], S[i]

  ans += 1
end

puts ans
