#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <ctime>
#include <climits>
#include <iomanip>
#include <bitset>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <string>
#include <queue>
#include <random>

#define int long long

#pragma GCC optimize("03,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

using ll = long long;
using ld = long double;
using namespace std;

const ll INF = 1e18;

int get_sum(int l, int r, vector<int>& pref) {
	if (l > r) {
		return 0;
	}
	int ans = pref[r];
	if (l != 0) {
		ans -= pref[l - 1];
	}
	return ans;
}

vector<int> left_less(vector<int> a) {
	int n = (int)a.size();
	vector<int> l(n, -1);
	vector<pair<int, int>> cur;
	for (int i = 0; i < n; i++) {
		while (!cur.empty() && cur.back().first >= a[i]) {
			cur.pop_back();
		}
		if (!cur.empty()) {
			l[i] = cur.back().second;
		}
		cur.push_back({ a[i], i });
	}
	return l;
}

vector<int> right_less(vector<int> a) {
	int n = (int)a.size();
	vector<int> r(n, -1);
	vector<pair<int, int>> cur;
	for (int i = n - 1; i >= 0; i--) {
		while (!cur.empty() && cur.back().first >= a[i]) {
			cur.pop_back();
		}
		if (!cur.empty()) {
			r[i] = cur.back().second;
		}
		cur.push_back({ a[i], i });
	}
	return r;
}


vector<int> op(vector<int>& c, int k, int m) {
	vector<int> a = c;
	int n = (int)a.size();
	vector<vector<int>> b;
	for (int i = 0; i < n; i++) {
		b.push_back({ a[i], -i });
	}
	sort(b.rbegin(), b.rend());
	while (m--) {

		for (int i = 0; i < k; i++) {
			a[-b[i][1]]--;
		}

		b.clear();
		for (int i = 0; i < n; i++) {
			b.push_back({ a[i], -i });
		}
		sort(b.rbegin(), b.rend());
	}
	return a;
}

void solve() {
	int n, m, num;
	cin >> n >> m >> num;
	vector<int> cnt(n);
	for (int i = 0; i < m; i++) {
		int v, u;
		cin >> v >> u;
		v--;
		u--;
		cnt[u]++;
	}
	int x = 0;
	for (int i = 0; i < n; i++) {
		x += max(0ll,cnt[i] - 1);
	}
	int y = 1;
	cout << x << "\n";
	cout << y;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	solve();
	return 0;
}