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

using namespace std;

#define int ll
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using ordered_set = __gnu_pbds::tree<int, __gnu_pbds::null_type, less<int>, __gnu_pbds::rb_tree_tag, __gnu_pbds::tree_order_statistics_node_update>;

mt19937 rnd(time(0));

const int MAXN = 2e3 + 52;
vector<int> g[MAXN];
vector<int> g1[MAXN];
vector<int> tp;
int used[MAXN];

void dfs_tp(int v) {
    used[v] = 1;
    for (auto &u: g[v]) {
        if (!used[u])dfs_tp(u);
    }
    tp.push_back(v);
}

void dfs(int v) {
    used[v] = 1;
    for (auto &u: g1[v]) if (!used[u]) dfs(u);
}

inline void solve() {
    int n, m, G;
    cin >> n >> m >> G;
    int M = m;
    while (m--) {
        int u, v;
        cin >> u >> v;
        u--;
        v--;
        g[u].push_back(v);
        g1[u].push_back(v);
        g1[v].push_back(u);
    }
    for (int i = 0; i < n; i++) {
        if (!used[i])
            dfs_tp(i);
    }
    reverse(all(tp));
    fill(used, used + MAXN, 0);
    int ans = 0;
    for (auto &v: tp) {
        if (!used[v]) {
            ans++;
            dfs(v);
        }
    }
    cout << M - n + 1 << " 1";
}

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