#P46. [KBC003F] Training

[KBC003F] Training

Source

This problem is adapted from Long Long OJ. All rights reserved.

Problem Description

There are nn people, each with two attributes: combat power and stamina.

The coach of these nn people is going to train them, and each training session involves two people (a,b)(a, b). One of the following training methods will be chosen:

  • Person aa practices swordsmanship, increasing their combat power by 1, while person bb watches from the side, increasing their stamina by 1;
  • Person bb practices swordsmanship, increasing their combat power by 1, while person aa watches from the side, increasing their stamina by 1.

Currently, mm pairs of people have been scheduled for training, and you get to decide the training method for each pair.

The coach wants every person's combat power and stamina to be even numbers. Your task is to find the minimum number of additional training sessions required.

Input Format

The first line contains two integers nn and mm. The next mm lines each contain two integers, representing the two people (x,y)(x, y) for each scheduled training session.

Output Format

Output a single integer, representing the minimum number of additional training sessions needed.

Samples

3 4
1 2
2 3
1 1
3 3
2

Sample Explanation

For convenience, a pair (x,y)(x, y) denotes that person xx's combat power increases by 1 and person yy's stamina increases by 1.

After the initial scheduled training sessions (1,2),(3,2),(1,1),(3,3)(1,2),(3,2),(1,1),(3,3), the stamina and combat power of each person are as follows:

ID Stamina Combat Power
11 22 11
22 00 22
33 22 11

After conducting additional training sessions (2,1)(2,1) and (2,3)(2,3), the stamina and combat power of each person become:

ID Stamina Combat Power
11 22
22
33

Data Range

For 100% of the data: 1n,m1051\le n,m\le 10^5, 1x,yn1\le x,y\le n.