#include <bits/stdc++.h>

//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx2")

//#define int long long

using ll = long long;
using namespace std;

void solve() {
    int n, m, kal, ans = 0, cnt = 1;
    cin >> n >> m >> kal;
    vector<pair<int, int>> e;
    for (int i = 0; i < m; i++) {
        int v, u;
        cin >> v >> u;
        v--;
        u--;
        if (u != v - 1) {
            ans++;
        }
    }
    cout << ans << " " << cnt << "\n";
}

signed main() {
    int tests = 1;
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
//    cin >> t;
#else
    ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
#endif
//    cin >> t;
    while (tests--) {
        solve();
    }
}
