#include <bits/stdc++.h>
using namespace std;
vector<int> a[100005];
vector<int> r[100005];
int dep[100005], stk[100005];
int u[100005];
int back[100005], cac[100005];
int ans = 0;
void handle(int L, int R) {
  for (int i = L; i <= R; i++) back[stk[i]] = L;
  int degcnt = 0;
  int atleast = 0;
  for (int i = L; i <= R; i++) {
    if (((int)(a[stk[i]]).size()) % 2) ++degcnt;
    if (((int)(a[stk[i]]).size()) > 2) ++atleast;
  }
  if (atleast <= 1) ans++;
}
void go(int x, int from = -1, int lev = 0) {
  u[x] = 1;
  dep[x] = lev;
  stk[lev] = x;
  back[x] = lev;
  for (__typeof((a[x]).begin()) it = (a[x]).begin(); it != (a[x]).end(); it++) {
    if (*it == from) continue;
    if (!u[*it])
      go(*it, x, lev + 1);
    else if (dep[*it] < lev)
      handle(dep[*it], lev);
  }
  if (from >= 0 && back[x] == lev) {
    r[x].push_back(from);
    r[from].push_back(x);
  }
}
void pass(int x, int from = -1) {
  u[x] = 1;
  int c = 0;
  for (__typeof((r[x]).begin()) it = (r[x]).begin(); it != (r[x]).end(); it++) {
    if (*it == from) continue;
    pass(*it, x);
    ++c;
  }
  if (from >= 0)
    ans += c / 2;
  else
    ans += (c + 1) / 2;
}
int main(void) {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[x].push_back(y);
    a[y].push_back(x);
  }
  for (int i = 1; i <= n; i++)
    if (!u[i]) go(i);
  for (int i = 1; i <= n; i++) u[i] = 0;
  for (int i = 1; i <= n; i++)
    if (!u[i]) pass(i);
  printf("%d %d\n", ans, m);
  return 0;
}
