#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, Q;
  cin >> N >> Q;
  vector<vector<int>> v(26);
  string s;
  cin >> s;
  vector<int> num(26, 1);
  vector<int> size(26, 0);
  for (int i = 0; i < s.size(); i++) {
    v[s[i] - 'A'].push_back(i);
    size[s[i] - 'A']++;
  }
  int count = N;
  char t, d;
  for (int i = 0; i < Q; i++) {
    cin >> t >> d;
    for (int j = 0; j < size[t - 'A']; j++) {
      if (d == 'L') {
        if (v[t - 'A'][j] == 0) {
          count -= num[v[t - 'A'][j]];
          num[v[t - 'A'][j]] = 0;
        } else {
          num[v[t - 'A'][j] - 1] += num[v[t - 'A'][j]];
          num[v[t - 'A'][j]] = 0;
        }
      }
      if (d == 'R') {
        if (v[t - 'A'][size[t - 'A'] - 1 - j] == N - 1) {
          count -= num[v[t - 'A'][size[t - 'A'] - 1 - j]];
          num[v[t - 'A'][size[t - 'A'] - 1 - j]] = 0;
        } else {
          num[v[t - 'A'][size[t - 'A'] - 1 - j] + 1] +=
              num[v[t - 'A'][size[t - 'A'] - 1 - j]];
          num[v[t - 'A'][size[t - 'A'] - 1 - j]] = 0;
        }
      }
    }
  }
  cout << count << endl;
}
