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