#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <cstdint>
using namespace std;
#define int long long

void solution();

int32_t main() {
#ifdef LOCAL
    freopen("test", "r", stdin);
    freopen("out", "w", stdout);
#endif

    int t = 1;
    // cin >> t;
    while (t--) {
        solution();
    }
}

void solution() {
    int n, m, g;
    cin >> n >> m >> g;

    int cnt = 0;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        u--; v--;

        if (v > u + 1) cnt++;
    }

    cout << cnt << " 1\n";
}