#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif using ll = long long; #define rep(i, n) for (int i = 0; i < (n); ++i) #include int main() { int n, m; cin >> n >> m; atcoder::dsu d(2 * n); rep(_, m) { int a, b; cin >> a >> b; --a, --b; d.merge(a, b); } auto g = d.groups(); ll ans = 0; for (auto&& e : g) ans += e.size() % 2; cout << (ans + 1) / 2 << endl; return 0; }