#include <bits/stdc++.h>
using namespace std;
const int maxn = 200008;
int n, m, f[maxn], in[maxn], huan[maxn], tot;
int ans, d[maxn], fa[maxn];
struct Tedge {
  int start[maxn], tot;
  struct arr {
    int a, next;
  } e[maxn << 2];
  void clear() {
    tot = 1;
    memset(start, 0, sizeof(start));
  }
  void add(int x, int y) {
    e[++tot].a = y;
    e[tot].next = start[x];
    start[x] = tot;
    e[++tot].a = x;
    e[tot].next = start[y];
    start[y] = tot;
  }
} E;
struct Tprogram {
  void open() {
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
  }
  void close() {}
  void init() {
    scanf("%d%d", &n, &m);
    int x, y;
    E.clear();
    for (int i = 1; i <= m; i++) {
      scanf("%d%d", &x, &y);
      E.add(x, y);
      d[x]++;
      d[y]++;
    }
    for (int i = 1; i <= n; i++) ans += (d[i] & 1);
    ans >>= 1;
  }
  void dfs(int u) {
    in[u] = ++tot;
    for (int i = E.start[u], v; v = E.e[i].a, i; i = E.e[i].next)
      if (!in[v]) {
        fa[v] = u;
        dfs(v);
      } else if (in[v] > in[u])
        huan[u] = v;
    if (huan[u]) {
      for (int v = huan[u]; v != u; v = fa[v])
        if (d[v] > 2) return;
      ans++;
    }
  }
  void work() {
    int p = 0;
    for (int i = 1; i <= n; i++)
      if (d[i] > d[p]) p = i;
    dfs(p);
    printf("%d %d\n", ans, m);
  }
} Program;
int main() {
  Program.init();
  Program.work();
  return 0;
}
