#include <bits/stdc++.h>
using namespace std;
#define Joyfine ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
const int N=1e5+10;
int _=1;
int n,m;
vector<int> g[N];
int fa[N], siz[N], sz[N];
int sg[3];
int f[N][2];
int find(int x) {return x==fa[x]?x:fa[x]=find(fa[x]);}
void merge(int u, int v) {
int fu = find(u);
int fv = find(v);
if (fu != fv) {
fa[fv] = fu;
siz[fu] += siz[fv];
}
}
void DFS(int u, int fa) {
for (auto v : g[u])
if (v != fa) {
DFS(v, u);
sz[u] = sz[u] + sz[v];
}
}
void dfs(int u, int fa) {
if (fa != 0) {
if ((siz[find(u)] - sz[u]) % 2)
f[u][1]++;
else
f[u][0]++;
}
for (auto v : g[u])
if (v != fa) {
if (sz[v] % 2)
f[u][1]++;
else
f[u][0]++;
dfs(v, u)}
}
void solve(int ce) {
sg[1] = 1;
sg[0] = 2;
int ans = 0;
cin >> n >> m;
for (int i = 1; i <= n; i++) fa[i] = i, siz[i] = 1, sz[i] = 1;
for (int i = 1, u, v; i <= m; i++) {
cin >> u >> v;
merge(u, v);
g[u].push_back(v);
g[v].push_back(u);
}
vector<int> v;
int sum = 0;
for (int i = 1; i <= n; i++) {
if (fa[i] == i) {
v.push_back(siz[i]);
sum ^= sg[siz[i] % 2];
}
}
for (auto i : v) {
if (sum == 2 && i % 2 == 0) {
ans += (i - 1);
} else if (sum == 2 && i % 2 == 1) {
ans += (i - 1);
}
}
for (int i = 1; i <= n; i++) {
if (fa[i] == i) {
DFS(i, 0);
dfs(i, 0);
}
}
for (int i = 1; i <= n; i++) {
// cout << siz[i] << endl;
int a1 = f[i][0] % 2, a2 = f[i][1] % 2;
if ((sum ^ sg[siz[find(i)] % 2] ^ (2 * a1) ^ (a2)) == 0) {
ans++;
}
// cout << f[i][0] << " " << f[i][1] << endl;
}
cout << ans;
}
signed main(void)
{
Joyfine;
// cin>>_;
for(int i=1;i<=_;i++) solve(i);
}