function main(input) {
    var stdin = input.split('\n')
    var masu_num = parseInt(stdin[0].split(" ")[0], 10)
    var magic_num = parseInt(stdin[0].split(" ")[1], 10)
    var masu = stdin[1].split("")
    var masu = masu.map((m) => [m, 1])

    var counter = 0
    while (magic_num > counter) {
        magic = stdin[counter+2].split(" ")
        result = []
        masu.forEach((elem, index) => {
            if (elem[0] == magic[0]) {
                if (magic[1] == "L") {
                    point = index - 1
                    if (0 > point) {
                        masu[index][1] = 0
                        next
                    }
                    result.push([point, elem[1]])
                    masu[index][1] = 0
                } else { //R
                    point = index + 1
                    if (point >= masu_num) {
                        masu[index][1] = 0
                        next
                    }
                    result.push([point, elem[1]])
                    masu[index][1] = 0
                }
            }
        })
        result.forEach((e) => masu[e[0]][1] += e[1])
        counter++
    }
    sum = 0
    masu.forEach((e) => {
        sum += e[1]
    })
    console.log(sum);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));