#3295. 食物链

食物链

说明

输入格式

第一行两个整数 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi></mrow></semantics></math>n 和 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi></mrow></semantics></math>m,接下来 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi></mrow></semantics></math>m 行每行两个整数 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>�</mi><mi>�</mi></msub><mtext> </mtext><msub><mi>�</mi><mi>�</mi></msub></mrow></semantics></math>ai bi 描述 <math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>�</mi></mrow></semantics></math>m 条能量流动关系。

输出格式

一个整数,即食物网中的食物链条数。 保证食物链满足生物学规律(无环)。

样例

10 16
1 2
1 4
1 10
2 3
2 5
4 3
4 5
4 8
6 5
7 6
7 9
8 5
9 8
10 6
10 7
10 9
9

提示

1N100000,0m200000

保证答案不会超过 int 的最大值。