#include <bits/stdc++.h>

using ll = long long;
using namespace std;
const int INF = 1e9, MOD = 1e9 + 7;
#define all(a) a.begin(), a.end()
#define rall(a) a.begin(), a.end()
void solve() {
    int n, m, g;
    cin >> n >> m >> g;
    int x = 0;
    for (int i = 0; i < m; ++i) {
        int u, v;
        cin >> u >> v;
        if (v - u != 1) {
            x++;
        }
    }
    cout << x << "\n1\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin >> t;
    while (t--) {
        solve();
    }
}
