#include <bits/stdc++.h>

using namespace std;
#define int long long

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m, G;
    cin >> n >> m >> G;
    vector<int> g[n];
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        g[u - 1].emplace_back(v - 1);
        g[v - 1].emplace_back(u - 1);
    }
    int cnt = 0, used[n];
    for (int i = 0; i < n; i++) used[i] = 0;
    function<void(int)> dfs = [&](int v) {
        used[v] = 1;
        for (auto u: g[v]) {
            if (!used[u])
                dfs(u);
        }
    };
    for (int i = 0; i < n; i++) {
        if (!used[i]) {
            cnt++;
            dfs(i);
        }
    }
    cout << m - n + cnt << "\n" << 0;
    return 0;
}