#include <bits/stdc++.h>
int main() {
  int N;
  int Q;
  scanf("%d %d", &N, &Q);
  char s[N];
  int M[N];
  scanf("%s", &s);
  for (int i = 0; i < N; i++) {
    M[i] = 1;
  }
  char g;
  char ju;
  for (int i = 0; i < Q; i++) {
    scanf("%s %s", &g, &ju);
    int b = 0;
    int j = 0;
    for (j = 0; b != 1; j++) {
      if (g == s[j]) {
        b = 1;
        printf("%c %c\n", g, s[j]);
      }
    }
    j = j - 1;
    if (ju == 'L') {
      if (j == 0) {
        M[0] = 0;
      } else {
        M[j - 1] = M[j - 1] + M[j];
        M[j] = 0;
      }
    } else if (ju == 'R') {
      if (j == N - 1) {
        M[N - 1] = 0;
      } else {
        M[j - 1] = M[j - 1] + M[j];
        M[j] = 0;
      }
    }
  }
  int sum = 0;
  for (int sum1 = 0; sum1 < N; sum1++) {
    sum = sum + M[sum1];
  }
  printf("%d\n", sum);
  return 0;
}
