#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, s, odw[100001];
vector<int> v[100001];
set<int> ss;
void dfs(int a) {
  if (v[a].size() != 2) {
    ss.insert(a);
    return;
  }
  odw[a] = 1;
  for (__typeof((v[a]).begin()) it = (v[a]).begin(); it != (v[a]).end(); ++it)
    if (!odw[*it]) dfs(*it);
}
int main() {
  scanf("%d%d", &n, &m) ?: 0;
  for (int i = 0; i < (m); ++i) {
    scanf("%d%d", &a, &b) ?: 0;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = (1); i <= (n); ++i) {
    if (v[i].size() & 1) s++;
    if (v[i].size() == 2 && !odw[i]) {
      dfs(i);
      if (ss.size() < 2) s += 2;
      ss.clear();
    }
  }
  printf("%d %d", s >> 1, m);
}
