def move(order)
  move_to = -1
  move_to = 1 if order[1] == "R"
  $tile[order[0]].each do|item|
    next if $map[item] == 0
    if item+move_to >= 0 && item+move_to < $n
      $map[item+move_to] += $map[item]
      $tile_sum[$sa[item+move_to]]  += $map[item]
      $tile_sum[$sa[item]] -= $map[item]
    end
    $map[item] = 0
  end
end

$n,q = gets.split(" ").map{|e| e.to_i}
$sa = gets.chomp.split("")
$tile = {}
$tile_sum = {}
$map = []
$sa.each_with_index do|item,idx|
  $tile[item] = [] if $tile[item].nil?
  $tile_sum[item] = 0 if $tile_sum[item].nil?
  $tile[item] << idx
  $tile_sum[item] += 1
  $map << 1
end
q.times do
  order = gets.split(" ")
  move(order) if (!$tile[order[0]].nil?) && $tile_sum[order[0]] != 0
end
sum = 0
$map.each do|a|
  sum+=a
end
puts sum