#include <bits/stdc++.h>
using namespace std;
const int MAXN = 123456;
int n, ans = 0;
bool vis[MAXN] = {};
vector<int> E[MAXN];
pair<int, int> dfs(int u, int v) {
  vis[v] = true;
  int tPos = -1, ret = 0, vPos = -1;
  for (vector<int>::iterator e = E[v].begin(); e != E[v].end(); e++) {
    if (*e == u) continue;
    if (vis[*e]) {
      vPos = *e;
      continue;
    }
    pair<int, int> tmp = dfs(v, *e);
    if (tmp.first != -1) {
      tPos = tmp.first;
      ret += tmp.second;
    }
  }
  if (((int)(E[v].size())) >= 3) ret++;
  ans += (((int)(E[v].size())) & 1);
  if (tPos == v) {
    if (ret <= 1) ans += 2;
    return pair<int, int>(-1, -1);
  }
  if (vPos != -1) return pair<int, int>(vPos, ret);
  if (tPos != -1) return pair<int, int>(tPos, ret);
  return pair<int, int>(-1, -1);
}
int main() {
  int m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    E[a].push_back(b);
    E[b].push_back(a);
  }
  dfs(-1, 0);
  cout << ans / 2 << " " << m << endl;
}
