#include <bits/stdc++.h>
using namespace std;
int vis[100010], dep[100010], fa[100010], ans, in[100010], val[100010];
vector<int> e[100010];
void get(int p, int q) {
  ans++;
  while (p != q) {
    in[p] = q;
    p = fa[p];
  }
  in[p] = q;
}
bool chk(int p, int q) {
  int cnt = 0;
  while (p != q) {
    if (((int)(e[p]).size()) > 2) cnt++;
    p = fa[p];
  }
  if (((int)(e[p]).size()) > 2) cnt++;
  return cnt >= 2;
}
void dfs(int p, int f, int lv) {
  vis[p] = 1;
  fa[p] = f;
  dep[p] = lv;
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (!vis[*it]) dfs(*it, p, lv + 1);
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (*it != f && dep[*it] < dep[p]) get(p, *it);
  int now = 0;
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (dep[*it] > dep[p] && (!in[*it] || !in[p] || in[*it] != in[p])) {
      if (val[*it] == 0) ans++;
      now++;
    }
  ans -= now / 2;
  val[p] = now % 2;
  for (__typeof((e[p]).begin()) it = (e[p]).begin(); it != (e[p]).end(); it++)
    if (*it != f && dep[*it] < dep[p] && chk(p, *it)) ans--;
}
int main() {
  int n, m, a, b;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a, &b);
    e[a].push_back(b);
    e[b].push_back(a);
  }
  dfs(1, 0, 1);
  printf("%d %d\n", ans, m);
  return 0;
}
