#include <bits/stdc++.h>

using namespace std;

const int N = 1e6 +123;

using ll = long long;

mt19937_64 rng (time (0));

#define int long long
int n, m, group;
vector<int> g[N];
vector<int> rg[N];
vector<pair<int,int>> e;
vector<int> G[N], rG[N];
vector<int> tops;
bool used[N];


void solve () {
    cin >> n >> m >> group;
    int ans = 0;
    for (int i = 1; i <= m; ++i) {
        int u, v; cin >> u >> v;
        e.push_back ({u, v});
        G[u].push_back (v);
        rG[v].push_back (u);
    }
    for (int i = 1; i <= n; ++i) {
        ans += (int)G[i].size() - 1;
    }
    cout << ans << '\n' << 0 << "\n";
}

signed main() {
#ifdef local
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif // local
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int test = 1;
    while (test--) solve();
}
