class Floor
  attr_accessor :golems, :index
  def initialize index
    self.golems = 1
    self.index = index
  end
  def delete
    self.golems = 0
  end
end

datas = gets.split(" ").map{|nn|nn.to_i}
n = datas[0]
q = datas[1]

map_data = gets.chomp.chars
map_data = map_data.map{|nn|Floor.new(nn)}

spells = []
q.times do
  spells << gets.split(" ")
end


spells.each do|spell|
  if spell[1] == "L"
    #脱落
    if map_data[0].index == spell[0]
      map_data[0].delete
    end
    for i in 1..(map_data.size-1)
      if map_data[i].index == spell[0] && map_data[i].golems > 0
        map_data[i-1].golems += map_data[i].golems
        map_data[i].golems = 0
      end
    end
  else
    #脱落
    if map_data[map_data.size-1].index == spell[0]
      map_data[map_data.size-1].delete
    end
    for i in 0..(map_data.size-2)
      if map_data[i].index == spell[0] && map_data[i].golems > 0
        map_data[i+1].golems += map_data[i].golems
        map_data[i].golems = 0
      end
    end
  end
end

ans = 0
map_data.each do|spot|
  ans += spot.golems
end
puts ans.to_s