#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n, m, t, ed, ans;
int s[N], f[N], d[N], u[N], low[N], fa[N], dfn[N], q[N], v[N], h[N], po[N * 10],
    ne[N * 10];
void dfs(int i) {
  ans += d[i] & 1;
  low[i] = dfn[i] = ++t;
  q[++ed] = i;
  v[i] = 1;
  for (int j = h[i], k; k = po[j], j; j = ne[j]) {
    if (k == fa[i]) continue;
    if (!dfn[k]) {
      fa[k] = i;
      dfs(k);
      low[i] = min(low[i], low[k]);
    } else if (v[i])
      low[i] = min(low[i], dfn[k]);
  }
  if (dfn[i] == low[i]) {
    int tt = 0;
    while (q[ed + 1] != i) {
      tt += d[q[ed]] > 2;
      ++s[i];
      u[q[ed]] = i;
      v[q[ed]] = 0;
      --ed;
    }
    if (tt == 1 && s[i] > 1) {
      ans += 2;
    }
  }
}
int main() {
  scanf("%d%d", &n, &m);
  if (m == 0) {
    puts("0 0");
    return 0;
  }
  int e = 1;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    ++e;
    ne[e] = h[x];
    po[e] = y;
    h[x] = e;
    ++e;
    ne[e] = h[y];
    po[e] = x;
    h[y] = e;
    ++d[x];
    ++d[y];
  }
  dfs(1);
  if (ans == 0) ans = 2;
  printf("%d %d\n", ans / 2, m);
  return 0;
}
