#include <bits/stdc++.h>
int N, M, tot, ans, head[600005], lk[600005], next[600005], d[600005],
    dfn[600005], fa[600005];
void add(int u, int v, int t) {
  lk[t] = v, next[t] = head[u], head[u] = t, d[u]++;
}
void dfs(int u) {
  dfn[u] = ++tot;
  int s = d[u] > 2;
  for (int i = head[u], v; v = lk[i], i; i = next[i])
    if (!dfn[v] && v != fa[u]) fa[v] = u, dfs(v);
  for (int i = head[u], v; v = lk[i], i; i = next[i])
    if (dfn[v] > dfn[u] && u != fa[v]) {
      for (; v != u; v = fa[v]) s += d[v] > 2;
      ans += 2 * (s <= 1);
    }
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1, u, v; i <= M; i++)
    scanf("%d%d", &u, &v), add(u, v, i), add(v, u, i + M);
  for (int i = 1; i <= N; i++) ans += d[i] & 1;
  dfs(1), printf("%d %d\n", ans / 2, M);
}
