#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <tuple>
#include <deque>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

const int INF = 2 * 1e9;
const ll MAX = 1e15;
const ll MIN = -1e15;
const ll MOD = 1e9 + 7;
const ld EPS = 1e-7;

vector<vector<int>> g, rg, dist;
vector<bool> used;
int ub, vb;

void a(int u) {
    used[u] = true;
    for (int v : g[u]) {
        if (!used[v] && (u != ub || v != vb)) a(v);
    }
}

void solve() {
    int n, m, q; cin >> n >> m >> q;
    g.assign(n, {});
    rg.assign(n, {});
    vector<pii> edge;
    for (int i = 0; i < m; i++) {
        int u, v; cin >> u >> v;
        u--, v--;
        g[u].push_back(v), rg[v].push_back(u);
        edge.emplace_back(u, v);
    }
    int ans = 0;
    for (auto [u, v] : edge) {
        used.assign(n, false);
        ub = u, vb = v;
        a(u);
        if (find(used.begin(), used.end(), false) != used.end()) ans++;
    }
    cout << ans - 1 << " " << ans << endl;
}

signed main() {

    cin.tie(nullptr);
    cout.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int t = 1; //cin >> t;
    while (t--) solve();
}
