#include <bits/stdc++.h>
const int maxn = 100010;
int n, m, ans, x, y, d[maxn], e[maxn][2];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &x, &y);
    if (d[x] < 2) e[x][d[x]] = y;
    if (d[y] < 2) e[y][d[y]] = x;
    d[x]++;
    d[y]++;
  }
  for (int i = 1; i <= n; i++)
    if (d[i] & 1) ans++;
  ans >>= 1;
  for (int i = 1; i <= n; i++)
    if (d[i] == 2) {
      x = e[i][0];
      y = e[i][1];
      if (x == y) {
        d[x] = 0;
        ans++;
        continue;
      }
      e[x][e[x][0] == i ? 0 : 1] = y;
      e[y][e[y][0] == i ? 0 : 1] = x;
    }
  printf("%d %d\n", ans, m);
}
