#pragma optimize("avx,avx2,bmi,bmi2,popcnt,lzcnt,fmi")
#pragma GCC "unroll-loops, O3"
#pragma GCC "O3"
#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, m, gr; cin >> n >> m >> gr;
    vector<int> g[n + 1];
    while (m--) {
        int u, v; cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    cout << m - n + 1;
    return 0;
}
