package main

import "fmt"
import "bufio"
import "os"
import "strings"

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var n int
	var q int
	var s string
	var slist []string
	var td []string
	var result []int
	fmt.Scan(&n)
	fmt.Scan(&q)
	fmt.Scan(&s)
	slist = strings.Split(s, "")
	var t string
	for true {
		if sc.Scan() {
			t = sc.Text()
			td = append(td, t)
		} else {
			break
		}
	}
	for i := 0; i < n; i++ {
		result = append(result, 1)
	}
	for _, a := range td {
		temp := strings.Split(a, " ")
		tempS := temp[0]
		tempM := temp[1]
		b := findS(slist, tempS)
		//fmt.Println(b)
		for i := 0; i < len(b); i++ {
			if b[i] == 0 && tempM == "L" {
				result[0] = 0
			} else if b[i] == n-1 && tempM == "R" {
				result[n-1] = 0
			} else {
				if tempM == "L" {
					result[b[i]-1] += result[b[i]]
					result[b[i]] = 0
				} else {
					result[b[i]+1] += result[b[i]]
					result[b[i]] = 0
				}
			}
		}
	}
	remain := 0
	for _, a := range result {
		remain += a
	}
	fmt.Println(remain)
}

func findS(slist []string, tempS string) []int {
	var result []int
	for i, a := range slist {
		if a == tempS {
			result = append(result, i)
		}
	}
	return result

}
