#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, q;
  string s;
  cin >> n >> q >> s;
  int p[n];
  int c = n;
  p[0] = 0;
  for (int i = 1; i < n; i++) {
    p[i] = p[i - 1] + 1;
  }
  char t, d;
  int m = 0;
  int o[n];
  for (int i = 0; i < n; i++) o[i] = -1;
  for (int i = 0; i < q; i++) {
    for (int l = 0; l < n; l++) {
    }
    cin >> t >> d;
    bool is_deleted = false;
    for (int j = 0; j < n; j++) {
      for (int l = 0; l < n; l++) {
        if (j == o[l]) {
          is_deleted = true;
        } else if (o[l] == -1) {
          break;
        }
      }
      if (!is_deleted) {
        if (s[j] == t) {
          cout << "j is " << j << endl;
          if (d == 'R') {
            p[j]++;
            if (p[j] > n - 1) {
              o[m] = j;
              m++;
              c--;
            }
          } else {
            p[j]--;
            if (p[j] < 0) {
              o[m] = j;
              m++;
              c--;
            }
          }
        }
      }
    }
  }
  cout << c << endl;
  return 0;
}
