#include <bits/stdc++.h>
const int tt = 100005;
struct edge {
  edge *nxt;
  int des;
  bool pd;
  void maker(edge *&a, int b) {
    nxt = a, des = b, pd = true;
    a = this;
  }
} w[tt << 3], *tot, *sta[tt];
int c[tt], fa[tt], res;
int dfs(int i) {
  int ans = c[i] & 1;
  for (edge *e = sta[i]; e; e = e->nxt)
    if (e->pd) {
      e->pd = w[e - w ^ 1].pd = false;
      if (!fa[e->des]) {
        fa[e->des] = i;
        ans += dfs(e->des);
      } else {
        int k = 0, j;
        for (j = i; j != fa[e->des]; j = fa[j]) k += (c[j] > 2);
        if (k == 1) res++;
      }
    }
  return ans;
}
int main() {
  int n, m, i, a, b;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) sta[i] = NULL, fa[i] = c[i] = 0;
  for (tot = w, i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    c[a]++, c[b]++;
    (tot++)->maker(sta[a], b);
    (tot++)->maker(sta[b], a);
  }
  for (res = 0, i = 1; i <= n; i++)
    if (!fa[i]) {
      fa[i] = -1;
      a = dfs(i);
      res += sta[i] ? a ? a / 2 : 1 : 0;
    }
  printf("%d %d\n", res, m);
  return 0;
}
