#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
int n, m, d[maxn], a, b, x, sum;
int vis[maxn], cnt[maxn], cur[maxn], rot[maxn];
vector<int> g[maxn];
void dfs(int k, int fa, int opp) {
  vis[k] = 1, rot[k] = opp, cnt[opp] = cnt[opp - 1] + (d[k] > 2);
  for (int i = 0; i < g[k].size(); i++) {
    if (g[k][i] != fa)
      if (!vis[g[k][i]])
        dfs(g[k][i], k, opp + 1);
      else if (rot[g[k][i]] != 0)
        x += (cnt[rot[k]] - cnt[rot[g[k][i]] - 1] < 2);
  }
  rot[k] = 0;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    d[a]++, d[b]++;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  for (int i = 1; i <= n; i++)
    if (d[i] & 1) x++;
  x = x >> 1, dfs(1, 0, 1);
  printf("%d %d\n", x, m);
  return 0;
}
