Dominos#512

Dominos

1 second
128 megabytes
Medium (≈1350)

Dominoes can inspire a variety of entertaining activities. For example, children enjoy arranging domino tiles in a line, placing them side by side. If you push one tile, it falls and knocks down the next one, which in turn knocks down the following one, and so on, until the chain reaction stops. However, there might be setups where not all tiles fall. In such cases, you need to push an additional tile to keep the chain reaction going.

Given a specific arrangement of dominoes, determine the minimum number of tiles that need to be pushed by hand to make all the dominoes fall.

Input

The first line contains two integers and m~(1 \le n, m \le 10^5), where is the number of domino tiles, and is the number of lines describing their interactions. The dominoes are numbered from to .

Each of the following lines contains two integers and , indicating that if the domino numbered falls, it will knock over the domino numbered .

Output

Print one integer — the minimum number of domino tiles that need to be pushed to make all the dominoes fall.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading