#include <bits/stdc++.h>
using namespace std;
const int maxn = 111111, maxm = 555555;
int a[maxm], b[maxm], fa[maxn], deg[maxn], adj[maxn][2], n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", a + i, b + i);
    a[i]--;
    b[i]--;
    if (deg[a[i]] < 2) adj[a[i]][deg[a[i]]] = b[i];
    if (deg[b[i]] < 2) adj[b[i]][deg[b[i]]] = a[i];
    deg[a[i]]++;
    deg[b[i]]++;
  }
  if (m == 0) {
    printf("%d %d\n", 0, 0);
    return 0;
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (deg[i] & 1) ans++;
  ans /= 2;
  vector<int> deg2;
  for (int i = 0; i < n; i++) {
    if (deg[i] == 2) {
      deg[i] = 0;
      int ai = adj[i][0];
      int bi = adj[i][1];
      if (ai == bi) {
        ans++;
        deg[ai] = 0;
        continue;
      }
      if (adj[ai][0] == i)
        adj[ai][0] = bi;
      else
        adj[ai][1] = bi;
      if (adj[bi][0] == i)
        adj[bi][0] = ai;
      else
        adj[bi][1] = ai;
    }
  }
  printf("%d %d\n", ans, m);
  return 0;
}
