#pragma GCC optimize("03")
#include <iostream>
#include <set>
#include <vector>
#include <random>
#include <iomanip>
//#include <fstream>
#include <algorithm>
#include <map>
#include <unordered_set>
#include <unordered_map>
#pragma GCC target("avx2")
#define int long long
const int INF = 1e7;
const int N = 3e5 + 1;
using namespace std;
void dfs(vector<vector<int>>& g, vector<bool>& used, vector<int>& top, int u) {
    used[u] = true;
    for (auto v : g[u]) {
        if (used[v]) continue;
        dfs(g, used, top, v);
    }
    top.push_back(u);
}
void dfs2(vector<vector<int>>& g, vector<int>& color, int u, int col) {
    color[u] = col;
    for (auto v : g[u]) {
        if (color[v] != 0) continue;
        dfs2(g, color, v, col);
    }
}
signed main()
{
    cin.tie(nullptr)->sync_with_stdio(false);
    int n, m, tp;
    cin >> n >> m >> tp;
    vector<vector<int>> g(n);
    vector<vector<int>> g2(n);
    int ans = 0;
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v;
        u--, v--;
        if (u + 1 != v) ans++;
        g[u].push_back(v);
        g2[v].push_back(u);
    }
    cout << ans << '\n' << 1 << '\n';
}