#include <bits/stdc++.h>

using ll = long long;
using namespace std;

int main() {
    int n, m, gr;
    cin >> n >> m >> gr;
    int ans = 0;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        if (v != u + 1) ans++;
    }
    cout << ans << " " << 1;
}