#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
using namespace std;
using namespace __gnu_pbds;

#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>

mt19937_64 rnd(1488);

vector<vector<int>> G;
vector<bool> used;

void dfs(int v) {
    used[v] = 1;
    for (auto i : G[v]) {
        if (!used[i]) {
            dfs(i);
        }
    }
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, t;
    cin >> n >> m >> t;
    G.resize(n);
    used.resize(n);
    for (int i = 0; i < m; ++i) {
        int x, y;
        cin >> x >> y;
        --x;
        --y;
        G[x].push_back(y);
        G[y].push_back(x);
    }
    int cnt = 0;
    for (int i = 0; i < n; ++i) {
        if (!used[i]) {
            dfs(i);
            ++cnt;
        }
    }
    cout << m - (n - cnt) << endl;
    cout << 0;
}

