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