#include <bits/stdc++.h>
using namespace std;
vector<int> neigh[100009];
int ans = 0;
int sum[100009];
int depth[100009];
void DFS(int v, int p, int d) {
  depth[v] = d;
  sum[depth[v]] = sum[depth[v] - 1] + (neigh[v].size() > 2);
  for (int i = 0; i < neigh[v].size(); i++) {
    int u = neigh[v][i];
    if (u == p) continue;
    if (!depth[u]) DFS(u, v, d + 1);
    if (depth[u] < depth[v]) {
      if (sum[depth[v]] - sum[depth[u] - 1] < 2) {
        ans++;
      }
    }
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    neigh[u].push_back(v);
    neigh[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (neigh[i].size() % 2) ans++;
  ans /= 2;
  DFS(1, 0, 1);
  printf("%d %d", ans, m);
}
