#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void chkmax(T& x, U y) {
  if (x < y) x = y;
}
template <typename T, typename U>
inline void chkmin(T& x, U y) {
  if (y < x) x = y;
}
int n, m;
int ans;
const int MAXN = 111111;
vector<int> adj[MAXN];
int par[MAXN], dp[MAXN];
void dfs(int u, int p) {
  par[u] = p, dp[u] = dp[p] + 1;
  ans += (adj[u].size() & 1);
  for (int i = 0; i < ((int)(adj[u].size())); i++) {
    int v = adj[u][i];
    if (v == p) continue;
    if (!dp[v]) {
      dfs(v, u);
    } else if (dp[v] > dp[u]) {
      int cnt = (adj[u].size() > 2);
      while (v != u) {
        if (adj[v].size() > 2) cnt++;
        v = par[v];
      }
      if (cnt < 2) ans += 2;
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(1, 0);
  cout << ans / 2 << ' ' << m << endl;
  return 0;
}
