#include <bits/stdc++.h>

using namespace std;
using ll = long long;

constexpr int MOD = 1e9 + 7;

pair<int, int> solveSCC(int n, vector<vector<int>> adj) {
    return {0, 1};
}

vector<int> findSCC(int n, vector<vector<int>> adj, vector<array<int, 2>> e) {
    vector<int> tin(n, -1), col(n, -1), fup(n), stk;
    int timer = 0, color = 0;
    auto tarjan = [&](auto self, int v) -> void {
        tin[v] = fup[v] = timer++;
        stk.push_back(v);
        for (int j : adj[v]) {
            if (v != e[j][0]) {
                continue;
            }
            int to = e[j][1];
            if (col[to] != -1) {
                continue;
            }
            if (tin[to] == -1) {
                self(self, to);
                fup[v] = min(fup[v], fup[to]);
            } else {
                fup[v] = min(fup[v], tin[to]);
            }
        }
        if (tin[v] == fup[v]) {
            int u;
            do {
                u = stk.back();
                stk.pop_back();
                col[u] = color;
            } while (u != v);
            color += 1;
        }
    };
    vector<int> app(n);
    int id = 0;
    for (int i = 0; i < n; ++i) {
        if (tin[i] == -1) {
            tarjan(tarjan, i);
        }
    }
    for (int x : col) {
        if (app[x] == false) {
            app[x] = ++id;
        }
    }
    for (int i = 0; i < n; ++i) {
        col[i] = app[col[i]] - 1;
    }
    return col;
}

void solve() {
    int n, m, group;
    cin >> n >> m >> group;

    vector<vector<int>> adj(n);
    vector<array<int, 2>> e(m);
    for (int i = 0; i < m; ++i) {
        int a, b;
        cin >> a >> b;
        --a, --b;
        e[i] = {a, b};
        adj[a].push_back(i);
        adj[b].push_back(i);
    }

    auto init_colors = findSCC(n, adj, e);
    vector<int> banned(m);
    int ans = 0;
    for (int i = 0; i < m; ++i) {
        swap(e[i][0], e[i][1]);
        auto cur_colors = findSCC(n, adj, e);
//        for (int x : cur_colors) {
//            cout << x << " ";
//        }
//        cout << endl;
        if (cur_colors == init_colors) {
            // I don't have the privilege to NOT specify this
        } else {
            ans += 1;
        }
        swap(e[i][0], e[i][1]);
    }
    cout << ans << " " << 1 << '\n';
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int test = 1;
//    cin >> test;
    while (test--) {
        solve();
    }

    return 0;
}