#include <bits/stdc++.h>
int sub(bool **list, int n, char t, char d) {
  int i, ans = 0;
  if (d == 'L') {
    for (i = 0; i < n; ++i) {
      if (list[i][((int)(t - 'A'))] == true) {
        if (i == 0) {
          ++ans;
        } else {
          list[i - 1][((int)(t - 'A'))] = true;
        }
        list[i][((int)(t - 'A'))] = false;
      }
    }
  } else if (d == 'R') {
    for (i = n - 1; i >= 0; --i) {
      if (list[i][((int)(t - 'A'))] == true) {
        if (i == n - 1) {
          ++ans;
        } else {
          list[i + 1][((int)(t - 'A'))] = true;
        }
        list[i][((int)(t - 'A'))] = false;
      }
    }
  }
  return ans;
}
void init(char *str, int n, bool **list) {
  int i;
  for (i = 0; i < n; ++i) {
    list[i][((int)(str[i] - 'A'))] = true;
  }
}
void plist(bool **list, int n) {
  int i, j;
  for (i = 0; i < n; ++i) {
    for (j = 0; j < 27; ++j) {
      if (list[i][j] == true) {
        printf(" 1");
      } else {
        printf(" 0");
      }
    }
    printf("\n");
  }
}
int main() {
  int n, q, i, j, ans;
  char t, d;
  scanf("%d %d", &n, &q);
  ans = n;
  char *str = (char *)malloc((n + 4) * sizeof(char));
  bool **list = (bool **)malloc((n + 4) * sizeof(bool *));
  for (i = 0; i < n; ++i) {
    list[i] = (bool *)malloc(27 * sizeof(bool));
    for (j = 0; j < 27; ++j) {
      list[i][j] = false;
    }
  }
  scanf("%s", str);
  fgetc(stdin);
  init(str, n, list);
  for (i = 0; i < q; ++i) {
    scanf("%c %c", &t, &d);
    fgetc(stdin);
    ans -= sub(list, n, t, d);
  }
  printf("%d\n", ans);
  return 0;
}
