#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, Q;
  string s;
  cin >> N >> Q >> s;
  vector<char> t(Q);
  vector<char> d(Q);
  for (int i = 0; i < Q; i++) {
    cin >> t[i] >> d[i];
  }
  map<char, vector<int>> mp;
  for (int i = 0; i < s.size(); i++) {
    mp[s[i]].push_back(i);
  }
  int ans = N;
  for (int i = 0; i < Q; i++) {
    vector<int> v;
    int tmp;
    if (d[i] == 'R') {
      tmp = 1;
    } else {
      tmp = -1;
    }
    for (int j = 0; j < mp[t[i]].size(); j++) {
      mp[t[i]][j] += tmp;
      if (mp[t[i]][j] < 0 || mp[t[i]][j] > N - 1) {
        ans--;
      } else {
        v.push_back(mp[t[i]][j]);
      }
    }
    mp[t[i]].erase(mp[t[i]].begin(), mp[t[i]].end());
    for (int vi = 0; vi < v.size(); vi++) {
      mp[s[v[vi]]].push_back(v[vi]);
    }
  }
  cout << ans << endl;
  return 0;
}
