#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const bool db = false;
int n, m, x, y, ans;
vector<int> gr[100010];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d", &x, &y);
    gr[x].push_back(y);
    gr[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) ans += gr[i].size() & 1;
  for (int i = 1; i <= n; ++i) {
    if (gr[i].size() == 2) {
      int x = gr[i][0], y = gr[i][1];
      if (x == y) {
        gr[x].clear(), ans += 2;
      } else {
        gr[x][gr[x][0] != i] = y;
        gr[y][gr[y][0] != i] = x;
      }
    }
  }
  cout << ans / 2 << " " << m << "\n";
  getchar();
  getchar();
  return 0;
}
