//#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
//#pragma GCC target("avx2")
using namespace std;
using ll = int64_t;
constexpr ll N = 2e3 + 1, mod = 1e9 + 7;
vector<ll> g[N];

void solve() {
    ll n, m, G;
    cin >> n >> m >> G;

    for (ll i = 0, a, b; i < m; ++i) {
        cin >> a >> b;
        g[a].push_back(b);
    }

    cout << m - n << endl;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll t = 1;
//    cin >> t;
    while (t --> 0) {
        solve();
    }

    return 0;
}

