#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
int n, m, ans;
vector<int> e[MAXN];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    e[u].push_back(v);
    e[v].push_back(u);
  }
  ans = 0;
  for (int i = 1; i <= n; i++) ans += (e[i].size() & 1);
  for (int i = 1; i <= n; i++) {
    if (e[i].size() != 2) continue;
    int x = e[i][0], y = e[i][1];
    if (x == y) {
      e[i].clear();
      e[x].clear();
      ans += 2;
      continue;
    }
    e[x][e[x][0] != i] = y;
    e[y][e[y][0] != i] = x;
  }
  printf("%d %d\n", ans >> 1, m);
  return 0;
}
