#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j, curr, n;
  cin >> curr >> n;
  int arr[curr + 1];
  int temp;
  arr[0] = 1;
  int count = curr - 1;
  for (i = 1; i <= curr; i++) arr[i] = 0;
  for (i = 0; i < n; i++) {
    cin >> temp;
    if (temp == 1) {
      int a, b;
      cin >> a >> b;
      arr[a] = 1;
      arr[b] = 1;
      count = count - 2;
    } else {
      int a;
      cin >> a;
      arr[a] = 1;
      count = count - 1;
    }
  }
  arr[curr] = 1;
  int min = 0;
  for (i = 1; i < curr; i++) {
    if (arr[i] == 0 && arr[i + 1] == 0) {
      min += 1;
      i++;
      continue;
    } else if (arr[i] == 0) {
      min += 1;
    }
  }
  cout << min << " " << count << endl;
  return 0;
}
