#include <iostream>
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

#define int long long
#define st first
#define nd second

typedef tree<int, null_type, std::less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;



signed main()
{
    int n, m, g;
    cin >> n >> m >> g;

    vector<vector<int>> G(n);
    for (int i = 0; i < m; ++i)
    {
        int v, u; cin >> v >> u; --v; --u;
        G[u].push_back(v);
    }

    vector<int> h(n, 0);
    for (int v = 0; v < n; ++v)
    {
        for (int u : G[v])
        {
            h[v] = min(h[v], 1 + h[u]);
        }
    }
    cout << n / 2 << '\n' << 1 << '\n';

    return 0;
}
