#include <bits/stdc++.h>

#define int long long
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using namespace std;

void solve_case() {
    int n, m, G; cin >> n >> m >> G;
    int mx = 0;
    for (int i = 0; i < m; i++) {
        int u, v; cin >> u >> v;
        if (u > v) {
            swap(u, v);
        }
        mx += (u + 1 != v);
    }
    cout << mx << ' ' << 1 << '\n';
}

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