#include <bits/stdc++.h>
#define ll long long
#define len(x) (int)x.size()
#define ld long double
#define all(x) x.begin(), x.end()
const ll mod1 = 1e9 + 7;

using namespace std;

void print(vector<int> &a){
    for(auto x : a){
        cout << x << ' ';
    }
    cout << '\n';
}

void print(vector<ll> &a){
    for(auto x : a){
        cout << x << ' ';
    }
    cout << '\n';
}

void print(vector<char> &a){
    for(auto x : a){
        cout << x << ' ';
    }
    cout << '\n';
}

void print(vector<string> &a){
    for(auto x : a){
        cout << x << ' ';
    }
    cout << '\n';
}

void print(vector<pair<int, int>> &a){
    for(auto x : a){
        cout << x.first << ' ' << x.second << '\n';
    }
}

void print(vector<vector<int>> &a){
    for(auto x : a){
        print(x);
    }
}

void print(vector<vector<ll>> &a){
    for(auto x : a){
        print(x);
    }
}

//#define int ll
//#define mtask

vector<vector<int>> g;
vector<bool> used;
vector<int> tour;

void dfs(int cur){
    used[cur] = true;
    for(auto x : g[cur]) if(!used[x]){
        dfs(x);
    }
    tour.push_back(cur);
}

void solve() {
    int n, m, grp;
    cin >> n >> m >> grp;
    g.resize(n);
    used.resize(n);
    for(int i = 0; i < m; ++i){
        int u, v;
        cin >> u >> v;
        --u, --v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
//    cout << m - (n - 1) << ' ' << 1 << '\n';
    int ans = 0;
    for(int i = 0; i < n; ++i){
        if(!used[i]) {
            tour.clear();
            dfs(i);
            int ed = 0;
            for(auto x : tour){
                ed += len(g[x]);
            }
            ed /= 2;
            ans += ed - (len(tour) - 1);
        }
    }
    assert(ans == (m - (n - 1)));
    cout << ans << ' ' << 1 << '\n';

}

signed main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
#ifdef mtask
    int tt;
    cin >> tt;
    while(tt--)
#endif
    solve();
}