#include <bits/stdc++.h>
using namespace std;
vector<int> q[100010];
int n, m, du, ans, c[100010];
int S[100010], top, fr[100010], cnt;
bool vis[100010], ins[100010];
void dfs(int u, int pr) {
  if (vis[u]) {
    if (!ins[u]) return;
    for (cnt++;;) {
      int x = S[top--];
      fr[x] = cnt, ins[x] = 0;
      if (x == u) break;
    }
    return;
  }
  vis[u] = 1;
  ins[u] = 1;
  S[++top] = u;
  for (int i = q[u].size() - 1; i >= 0; i--)
    if (q[u][i] != pr) dfs(q[u][i], u);
  if (ins[u]) ins[u] = 0, top--;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1, x, y; i <= m; i++) {
    scanf("%d %d", &x, &y);
    q[x].push_back(y);
    q[y].push_back(x);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs(i, -1);
  for (int i = 1; i <= n; i++) {
    ans += q[i].size() & 1;
    c[fr[i]] += q[i].size() > 2;
  }
  ans >>= 1;
  for (int i = 1; i <= cnt; i++)
    if (c[i] < 2) ans++;
  cout << ans << ' ' << m;
  return 0;
}
