#include <bits/stdc++.h>
using namespace std;
int a[5000];
int main() {
  int n, m;
  cin >> n >> m;
  int nn = n;
  for (long long i = 0; i < m; i++) {
    int x, y, u;
    cin >> x;
    if (x == 1) {
      cin >> y >> u;
      a[y] = -1;
      a[u] = -1;
      nn -= 2;
    } else {
      cin >> y;
      a[y] = -1;
      nn--;
    }
  }
  int s = 0;
  int ans = 0;
  for (long long i = 1; i <= n - 1; i++) {
    if (a[i] != -1) s++;
    if (a[i] == -1) ans += (s / 2 + s % 2), s = 0;
  }
  ans += (s / 2 + s % 2);
  cout << ans << ' ' << nn - 1;
}
