#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> g[100010];
bool vis[100010];
unordered_set<int> st;
void dfs(int np) {
  if (g[np].size() != 2) {
    st.insert(np);
    return;
  }
  vis[np] = 1;
  for (auto &x : g[np]) {
    if (!vis[x]) dfs(x);
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1, ti, tj; i <= m; i++) {
    scanf("%d%d", &ti, &tj);
    g[ti].push_back(tj);
    g[tj].push_back(ti);
  }
  int res = 0;
  for (int i = 1; i <= n; i++) res += g[i].size() & 1;
  res >>= 1;
  for (int i = 1; i <= n; i++) {
    if (g[i].size() == 2 && !vis[i]) {
      st.clear();
      dfs(i);
      if (st.size() <= 1) res++;
    }
  }
  printf("%d %d\n", res, m);
  return 0;
}
