#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int64_t n, m, G;
	cin >> n >> m >> G;
	vector<vector<int64_t>> g(n);
	for (int64_t i = 0; i < m; ++i) {
		int64_t u, v;
		cin >> u >> v;
		u--; v--;
		g[u].push_back(v);
	}
	cout << m - 1 << '\n' << m << '\n';
	return 0;
}