#include <bits/stdc++.h>
const int INF32 = 2147483647;
const long long INF64 = 9223372036854775807;
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, Q;
  string s;
  cin >> N >> Q >> s;
  vector<char> t(Q), d(Q);
  for (int i = 0; i < Q; i++) cin >> t[i] >> d[i];
  vector<pair<char, int>> index(N);
  vector<int> alp(27);
  for (int i = 0; i < N; i++) {
    index[i].first = s[i];
    index[i].second = i;
    alp[s[i] - 'A' + 1]++;
  }
  for (int i = 1; i < 27; i++) alp[i] += alp[i - 1];
  alp[26] = N;
  sort(index.begin(), index.end());
  int ans = 0;
  for (int i = 0; i < Q; i++) {
    int a = t[i] - 'A' + 1;
    for (int j = alp[a]; j < alp[a + 1]; j++) {
      if (d[i] == 'L')
        index[i].second--;
      else
        index[i].second++;
      if (index[i].second < 0 ||
          N < index[i].second && index[i].second != INF32) {
        ans++;
        index[i].second = INF32;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
