#include <bits/stdc++.h>
using namespace std;
map<int, int> p;
int G[101][101], V, b = 0;
vector<int> visted(100), cycle;
stack<int> s, s1;
int cnt = 0;
void containsOdd(int src) {
  int colorArr[V + 1];
  for (int i = 1; i <= V; ++i) colorArr[i] = -1;
  colorArr[src] = 1;
  queue<int> q;
  q.push(src);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int v = 1; v <= V; v++) {
      if ((G[u][v] || G[v][u]) && colorArr[v] == -1) {
        colorArr[v] = 1 - colorArr[u];
        q.push(v);
      } else if ((G[u][v] || G[v][u]) && colorArr[v] == colorArr[u]) {
        cnt++;
      }
    }
    if (q.empty()) {
      for (int v = 1; v <= V; v++) {
        if (colorArr[v] == -1) {
          colorArr[v] = 1;
          q.push(v);
          break;
        }
      }
    }
  }
}
int main() {
  int m, x, y;
  memset(G, 0, sizeof(G));
  cin >> V >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    G[x][y] = 1;
    G[y][x] = 1;
  }
  containsOdd(1);
  cnt /= 2;
  cnt = ((V - cnt) % 2 == 0) ? cnt : cnt + 1;
  cout << cnt << endl;
  return 0;
}
