#include <bits/stdc++.h>   using namespace std;   template <typename T>   void fast_scan(T &number);   template <typename T>   inline void fast_scan(T *nums, size_t size);   size_t fast_scan_line(char *chars, size_t size);   size_t fast_scan_word(char *chars, size_t size);   inline void fast_write(int num);   inline void fast_write(char *str);   int comp_double(double a, double b);   vector<string> string_split(char *str, char *delimiter);   int n, m;   int p[101][2];   bool used[101];   unsigned int ex = 0;   void dfs(int c_node, int p_node, int &c) {     int *enemies = p[c_node];     if (used[c_node] || c_node == 0) return;     used[c_node] = true;     c++;     if (enemies[0] != p_node) {       if (used[enemies[0]] && enemies[1] == p_node) {         if (c & 1) {           ex++;         }       } else {         dfs(enemies[0], c_node, c);       }     }     if (enemies[1] != p_node) {       if (used[enemies[1]] && enemies[0] == p_node) {         if (c & 1) {           ex++;         }       } else {         dfs(enemies[1], c_node, c);       }     }   }   void read() {     fast_scan(n);     fast_scan(m);     int t1, t2;     for (int i = 0; i < m; ++i) {       fast_scan(t1);       fast_scan(t2);       if (p[t1][0] == 0) {         p[t1][0] = t2;       } else {         p[t1][1] = t2;       }       if (p[t2][0] == 0) {         p[t2][0] = t1;       } else {         p[t2][1] = t1;       }     }   }   void solve() {     for (int i = 1; i < n + 1; ++i) {       int c = 0;       dfs(i, 0, c);     }     if ((n - ex) & 1) {       cout << (ex + 1);     } else {       cout << ex;     }   }   int main() {     ios::sync_with_stdio(false);     cin.tie(nullptr);     read();     solve();     return 0;   }   size_t fast_scan_word(char *chars, size_t size) {     char temp;     for (int i = 0; i < size; ++i) {       temp = (char)getchar();       if (temp ==   n  || temp ==     || temp ==   0 ) return i;       chars[i] = temp;     }   }   size_t fast_scan_line(char *chars, size_t size) {     char temp;     for (int i = 0; i < size; ++i) {       temp = (char)getchar();       if (temp ==   n  || temp ==   0 ) return i;       chars[i] = temp;     }   }   template <typename T>   void fast_scan(T &number) {     bool negative = false;     int c;     number = 0;     c = getchar();     if (c ==  - ) {       negative = true;       c = getchar();     }     for (; (c > 47 && c < 58); c = getchar()) number = number * 10 + c - 48;     if (negative) number *= -1;   }   template <typename T>   inline void fast_scan(T *nums, size_t size) {     for (size_t i = 0; i < size; ++i) fast_scan(nums[i]);   }   inline void fast_write(int num) {     int N = num, rev, count = 0;     rev = N;     if (N == 0) {       putchar( 0 );       putchar(  n );       return;     }     if (N < 0) {       putchar( - );       N *= -1;     }     while ((rev % 10) == 0) {       count++;       rev /= 10;     }     rev = 0;     while (N != 0) {       rev = (rev << 3) + (rev << 1) + N % 10;       N /= 10;     }     while (rev != 0) {       putchar(rev % 10 +  0 );       rev /= 10;     }     while (count--) putchar( 0 );   }   inline void fast_write(char *str) {     for (int i = 0; str[i]; i++) putchar(str[i]);   }   int comp_double(double a, double b) {     if (abs(a - b) <= 1e-9) return 0;     return a < b ? -1 : 1;   }   vector<string> string_split(char *str, char *delimiter) {     vector<string> tokens;     char *token = strtok(str, delimiter);     while (token != nullptr) {       tokens.emplace_back(token);       token = strtok(nullptr, delimiter);     }     return tokens;   }   vector<string> split(const string &s, char delimiter) {     vector<string> tokens;     string token;     istringstream tokenStream(s);     while (getline(tokenStream, token, delimiter)) {       tokens.push_back(token);     }     return tokens;   }