#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;

int ans = 0;
vector<int> used;
vector<set<int>> G;

mt19937_64 rnd(std::chrono::steady_clock::now().time_since_epoch().count());

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

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

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

    for (int v = 0; v < n; ++v)
    {
        for (int u : G[v])
        {
            ans += (h[v] - h[u] > 1);
        }
    }

    cout << ans + 1 << '\n' << 1 << '\n';

    return 0;
}
