#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, q;
  string s;
  cin >> n >> q >> s;
  char t, d;
  int count_g[n], ssize = s.size();
  for (int i = 0; i < n; i++) count_g[i] = 1;
  int j;
  for (int i = 0; i < q; i++) {
    cin >> t >> d;
    if (d == 'R') {
      for (j = 0; j < ssize - 1; j++) {
        if (s[j] == t) {
        }
      }
      if (s[j] == t) count_g[j] = 0;
    } else {
      if (s[0] == t) count_g[0] = 0;
      for (j = 1; j < ssize; j++) {
        if (s[j] == t) {
        }
      }
    }
  }
  int sum = 0;
  for (int x : count_g) sum += x;
  cout << sum << endl;
  return 0;
}
