function Main(input) {
    const N = parseInt(input[0]);
    const Q = parseInt(input[1]);
    const S = input[2];
    const TD = input.slice(3);

    var start = 1;
    var end = N;
    for (var i = Q - 1; i >= 0; i--) {
        var t = TD[i * 2];
        var d = TD[i * 2 + 1];
        if (d == "R") {
            if (S[end - 1] == t) {
                end--;
            }
        } else {
            if (S[start - 1] == t) {
                start++;
            }
        }
    }
    console.log(Math.max(end - start + 1, 0));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));