#include <iostream>
#include <random>
#include <numeric>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using namespace std;
using ll = long long;
using ull = unsigned long long;

constexpr int maxn = 2010;

int n, m, group;
vector<int> g[maxn];
int in_cnt[maxn], out_cnt[maxn];

void solve() {
    cin >> n >> m >> group;
    for (int i = 0, u, v; i < m; ++i) {
        cin >> u >> v, --u, --v;
        g[u].push_back(v);
        ++out_cnt[u], ++in_cnt[v];
    }
    cout << m - (n - 1) << "\n";
    cout << "1\n";
}

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr);
    int t = 1;
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    cin >> t;
#else
#ifdef TEST
    freopen("input.txt", "r", stdin);
#else
#endif
#endif
    while (t--) {
        solve();
        cout << "\n";
    }
    return 0;
}
