#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<random>
#include<chrono>
#include<set>
#include<deque>
#include<array>
//#define int long long
#define all(v) v.begin(), v.end()
#define ll long long
#define ld long double
using namespace std;
mt19937 rnd(chrono::steady_clock().now().time_since_epoch().count());
vector<vector<int>> g;
void solve() {
	int n, m, G;
	cin >> n >> m >> G;
	g.resize(n);
	vector<int> cnt(n);
	for (int i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		g[a].push_back(b);
		cnt[b]++;
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (cnt[i]) {
			ans += cnt[i] - 1;
		}
	}
	cout << ans << " " << 1;
}

signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	//cin >> t;
	t = 1;
	while (t--) {
		solve();
	}
}
