#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, Q, count = 0, s[2 * 100000 + 2];
  char pos, dir, str;
  vector<int> alpha[26];
  cin >> N >> Q;
  s[0] = 0;
  s[N + 1] = 0;
  for (int i = 1; i < N + 1; i++) {
    cin >> str;
    s[i] = 1;
    alpha[str - 65].push_back(i);
  }
  for (int i = 0; i < Q; i++) {
    cin >> pos >> dir;
    for (int j = 0; j < alpha[pos - 65].size(); j++) {
      if (dir == 'R') {
        s[alpha[pos - 65][j] + 1] += s[alpha[pos - 65][j]];
        s[alpha[pos - 65][j]] = 0;
      } else {
        s[alpha[pos - 65][j] - 1] += s[alpha[pos - 65][j]];
        s[alpha[pos - 65][j]] = 0;
      }
    }
  }
  cout << N - s[0] - s[N + 1];
}
