#include <bits/stdc++.h>
using namespace std;
const int oo = 1047483647, maxn = 100100;
;
int du[200000], e[200000][3];
int main() {
  int n, m, ans = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    du[a]++;
    du[b]++;
    if (du[a] <= 2) e[a][du[a]] = b;
    if (du[b] <= 2) e[b][du[b]] = a;
  }
  for (int i = 1; i <= n; i++)
    if (du[i] & 1) ans++;
  ans >>= 1;
  for (int i = 1; i <= n; i++)
    if (du[i] == 2) {
      int a = e[i][1];
      int b = e[i][2];
      if (a == b) {
        du[a] = 0, ans++;
        continue;
      }
      if (i == e[a][1])
        e[a][1] = b;
      else
        e[a][2] = b;
      if (i == e[b][1])
        e[b][1] = a;
      else
        e[b][2] = a;
    }
  printf("%d %d\n", ans, m);
  return 0;
}
