#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
vector<int> type;
int memo[4010][3];
int r;
int solve(int pos, int prev) {
  if (pos == r) return 0;
  int& ret = memo[pos][prev];
  if (~ret) return ret;
  if (type[pos])
    ret = solve(pos + 1, type[pos]);
  else {
    int cas1 = 1 + solve(pos + 1, 1);
    int cas2 = solve(pos + 1, 2);
    if (!type[pos - 1] and prev != 2)
      ret = min(cas1, cas2);
    else
      ret = cas1;
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  int k;
  cin >> r >> k;
  type = vector<int>(r + 1);
  type[r] = 1;
  for (int i = (0); i < (k); ++i) {
    int op;
    cin >> op;
    op = 2 - op + 1;
    for (int j = (0); j < (op); ++j) {
      int x;
      cin >> x;
      type[x] = j + 1;
    }
  }
  int maxx = 0;
  for (int i = (1); i < (r); ++i) {
    if (type[i] == 0) {
      ++maxx;
    }
  }
  memset((memo), (-1), sizeof(memo));
  int minn = solve(1, 2);
  cout << minn << " " << maxx;
  return 0;
}
