#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define pb push_back
#define C make_pair
#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)
#define FORD(i, b, a) for(int i = (b), _a = (a); i >= _a; i--)
#define REP(i, n) for(int i = 0, _n = (n); i < _n; i++)
#define MASK(i) (1LL << (i))
#define BIT(i, x) ((x) & MASK(i))
#define TURN_ON(i, x) ((x) | MASK(i))
#define TURN_OFF(i, x) ((x) & ~MASK(i))
#define REV(i, x) ((x) ^ MASK(i))
template<typename T>bool maximize(T &res, const T &a){if(res < a) return res = a, true; return false;}
template<typename T>bool minimize(T &res, const T &a){if(res > a) return res = a, true; return false;}
const int maxn = (int)1e5 + 5;
const ll MOD = (ll)1e9 + 7;
const ll INF = (ll)1e15;
typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef pair<ll, ll> pl;
typedef pair<ll, pl> pll;
int n, m, low[10010], num[10010], child[10010], cnt, bridge, res;
bool khop[10010];
vector<int>a[10010];
void dfs(int u, int pre){
num[u] = low[u] = ++cnt;
for(int v: a[u]){
if(v == pre) continue;
if(num[v]) minimize(low[u], num[v]);
else{
dfs(v, u);
minimize(low[u], low[v]);
child[u]++;
if(low[v] > num[u]) bridge++;
if(u == pre){
if(child[u] >= 2) khop[u] = 1;
}
else if(low[v] >= num[u]) khop[u] = 1;
}
}
}
void nhap(){
cin >> n >> m;
FOR(i, 1, m){
int u, v; cin >> u >> v;
a[u].pb(v);
a[v].pb(u);
}
}
void solve(){
FOR(i, 1, n) if(!num[i]) dfs(i, i);
FOR(i, 1, n) if(khop[i]) res++;
cout << res << " " << bridge;
}
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
nhap();
solve();
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgc2Ug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