#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v(26, 0);
  int a;
  long long b;
  string s;
  cin >> a >> b >> s;
  for (char c : s) {
    int index = c - 'A';
    int x = v.at(index);
    v[index] = ++x;
  }
  char point;
  char command;
  for (long long i = 0; i < b; i++) {
    cin >> point >> command;
    int index = point - 'A';
    if (command == 'R') {
      if (index == a - 1)
        v[index] = 0;
      else {
        v[index + 1] = v[index + 1] + v[index];
        v[index] = 0;
      }
    } else {
      if (index == 0)
        v[index] = 0;
      else {
        v[index - 1] = v[index - 1] + v[index];
        v[index] = 0;
      }
    }
  }
  int ans = 0;
  for (int x : v) {
    ans += x;
  }
  cout << ans;
  return 0;
}
