Codeforces Round 133 (Div. 2)
B
Forming Teams
Codeforces
1700
原题
← AC →
翻译中…

One day $*n*$ students come to the stadium. They want to play football, and for that they need to split into teams, the teams must have an equal number of people.

翻译中…

We know that this group of people has archenemies. Each student has at most two archenemies. Besides, if student $*A*$ is an archenemy to student $*B*$, then student $*B*$ is an archenemy to student $*A*$.

翻译中…

The students want to split so as no two archenemies were in one team. If splitting in the required manner is impossible, some students will have to sit on the bench.

翻译中…

Determine the minimum number of students you will have to send to the bench in order to form the two teams in the described manner and begin the game at last.

翻译中…

Input

翻译中…

The first line contains two integers $*n*$ and $*m*$ ($2 ≤ *n* ≤ 100$, $1 ≤ *m* ≤ 100$) — the number of students and the number of pairs of archenemies correspondingly.

翻译中…

Next $*m*$ lines describe enmity between students. Each enmity is described as two numbers $*a*_{*i*}$ and $*b*_{*i*}$ ($1 ≤ *a*_{*i*}, *b*_{*i*} ≤ *n*$, $*a*_{*i*} ≠ *b*_{*i*}$) — the indexes of the students who are enemies to each other. Each enmity occurs in the list exactly once. It is guaranteed that each student has no more than two archenemies.

翻译中…

You can consider the students indexed in some manner with distinct integers from 1 to $*n*$.

翻译中…

Output

翻译中…

Print a single integer — the minimum number of students you will have to send to the bench in order to start the game.

翻译中…

样例

Input #1
5 4
1 2
2 4
5 3
1 4
Output #1
1
InputCopy OutputCopy
Input #2
6 2
1 4
3 4
Output #2
0
InputCopy OutputCopy
Input #3
6 6
1 2
2 3
3 1
4 5
5 6
6 4
Output #3
2
InputCopy OutputCopy
题目信息
题号
216B
时间限制
2 s
内存限制
256 MB
标签
DFS 及类似
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。