#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <experimental/random>

#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3, unroll-loops")
using namespace __gnu_pbds;
using namespace std;
using ordered_set = tree<long long, null_type, less_equal<>, rb_tree_tag, tree_order_statistics_node_update>;
using ll = long long;
using ld = long double;
using str = string;
#define all(a) a.begin(), a.end()
#define len(a) int(a.size())
#define pb push_back
#define pbb pop_back
#define vc vector
#define F first
#define S second
#define rev reverse
vector<vector<int>> g;

void bfs(int v, vector<int>& d) {
    d[v] = 0;
    queue<int> q;
    q.push(v);
    while (!q.empty()) {
        v = q.front();
        for (int u : g[v]) {
            if (d[u] > d[v] + 1) {
                d[u] = d[v] + 1;
                q.push(v);
            }
        }
    }
}

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m, group;
    cin >> n >> m >> group;
    vector<pair<int, int>> ed;
    vector<vector<int>> d(n, vector<int>(n));
    g.resize(n);
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        g[u - 1].pb(v - 1);
        g[v - 1].pb(u - 1);
    }
    cout << (m - n);
    return 0;
}
