#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 100;
vector<int> e[MAXN];
int n, m, cnt;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    e[x].push_back(y), e[y].push_back(x);
  }
  for (int i = 1; i <= n; ++i) cnt += e[i].size() % 2;
  for (int i = 1; i <= n; ++i)
    if (e[i].size() == 2) {
      int x = e[i][0], y = e[i][1];
      if (x == y)
        e[x].clear(), cnt += 2;
      else
        e[x][e[x][0] != i] = y, e[y][e[y][0] != i] = x;
    }
  cout << cnt / 2 << " " << m << endl;
  fclose(stdin);
  fclose(stdout);
  return 0;
}
