#include <bits/stdc++.h>
using namespace std;
template <class T>
inline string itos(T n) {
  return (n) < 0    ? "-" + itos(-(n))
         : (n) < 10 ? (string)("") + (char)('0' + (n))
                    : itos((n) / 10) + itos((n) % 10);
}
int stoi(string _string) {
  char char_str[20];
  strcpy(char_str, _string.c_str());
  return atoi(char_str);
}
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
int A[1001];
int main() {
  int box, hint, n;
  int left, right;
  string dump, word;
  while (cin >> box >> hint) {
    left = 1;
    right = box;
    for (int i = 0; i < hint; i++) {
      cin >> dump >> dump >> word >> dump >> n;
      if (word.compare("left") == 0) {
        right = (right < n - 1 ? right : n - 1);
      } else {
        left = (left > n + 1 ? left : n + 1);
      }
    }
    if (right - left + 1 <= 0)
      cout << -1 << endl;
    else
      cout << right - left + 1 << endl;
  }
  return 0;
}
