#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int n, m, dfn[maxn], low[maxn], en, t, ans, in[maxn];
bool instack[maxn];
stack<int> sta;
struct edge {
  int e, id;
  edge *next;
} * v[maxn], ed[maxn * 6];
void add_edge(int s, int e, int id) {
  en++;
  ed[en].next = v[s];
  v[s] = ed + en;
  v[s]->e = e;
  v[s]->id = id;
}
void dfs(int now, int id) {
  t++;
  dfn[now] = low[now] = t;
  instack[now] = true;
  sta.push(now);
  for (edge *e = v[now]; e; e = e->next)
    if (e->id != id) {
      if (!dfn[e->e]) {
        dfs(e->e, e->id);
        low[now] = min(low[now], low[e->e]);
      } else {
        if (instack[e->e]) low[now] = min(low[now], dfn[e->e]);
      }
    }
  if (low[now] == dfn[now]) {
    if (sta.top() == now) {
      sta.pop();
      instack[now] = false;
      return;
    }
    int size = 0;
    while (sta.top() != now) {
      size += in[sta.top()] > 2;
      instack[sta.top()] = false;
      sta.pop();
    }
    instack[now] = false;
    sta.pop();
    size += in[now] > 2;
    ans += size < 2;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int a = 1; a <= m; a++) {
    int s, e;
    scanf("%d%d", &s, &e);
    add_edge(s, e, a);
    add_edge(e, s, a);
    in[s]++;
    in[e]++;
  }
  for (int a = 1; a <= n; a++) ans += in[a] & 1;
  ans >>= 1;
  for (int a = 1; a <= n; a++)
    if (!dfn[a]) dfs(a, 0);
  printf("%d %d\n", ans, m);
  return 0;
}
