#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
vector<int> G[maxn];
bool vis[maxn];
int p[maxn];
int ans;
int loop[maxn];
int deg;
void dfs(int u, int fa) {
  deg += G[u].size() & 1;
  p[u] = fa;
  vis[u] = true;
  for (int v : G[u]) {
    if (v == fa || loop[u] == v) continue;
    if (vis[v]) {
      loop[v] = u;
      int t = u;
      int cnt = 0;
      while (t != p[v]) {
        cnt += G[t].size() > 2;
        t = p[t];
      }
      ans += cnt < 2;
    } else
      dfs(v, u);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    int u, v;
    scanf("%d %d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  dfs(1, 0);
  printf("%d %d\n", deg / 2 + ans, m);
  return 0;
}
