#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int ESIZE = 300005 << 1;
int n, m;
int et = 1, fir[MAXN], to[ESIZE], ne[ESIZE];
bool bk[ESIZE];
int sta[ESIZE], top;
bool vis[MAXN];
int dgr[MAXN], ans, cnt;
void link(int u, int v) { to[++et] = v, ne[et] = fir[u], fir[u] = et; }
void dfs(int o, int fa) {
  vis[o] = 1;
  for (int i = fir[o]; i; i = ne[i])
    if (i != fa && !bk[i]) {
      sta[++top] = i;
      if (!vis[to[i]])
        dfs(to[i], i ^ 1);
      else {
        while (to[sta[top] ^ 1] != to[i])
          bk[sta[top]] = bk[sta[top] ^ 1] = 1, top--;
        bk[sta[top]] = bk[sta[top] ^ 1] = 1, top--;
      }
      if (sta[top] == i) top--;
    }
}
void dfs_1(int o) {
  vis[o] = 1;
  for (int i = fir[o]; i; i = ne[i])
    if (!bk[i]) {
      dgr[o]++;
      if (!vis[to[i]]) dfs_1(to[i]);
    }
  if (dgr[o] & 1) ans++;
}
void dfs_2(int o, int fa) {
  vis[o] = 1;
  bool flag = 0;
  for (int i = fir[o]; i; i = ne[i])
    if (bk[i]) {
      flag = 1;
      break;
    }
  if (!flag) {
    cnt = 100;
    return;
  }
  cnt += dgr[o] > 0;
  for (int i = fir[o]; i; i = ne[i])
    if (i != fa && bk[i] && !vis[to[i]]) dfs_2(to[i], i ^ 1);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1, x, y; i <= m; i++) {
    scanf("%d %d", &x, &y);
    link(x, y), link(y, x);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++) vis[i] = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs_1(i);
  ans >>= 1;
  for (int i = 1; i <= n; i++) vis[i] = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      cnt = 0, dfs_2(i, 0);
      ans += cnt <= 1;
    }
  printf("%d %d", ans, m);
  return 0;
}
