ShusekiKingdomistheworldsleadingnationforinnovationandtechnology. Therearencitiesinthekingdom, numberedfrom1ton. ThankstoMr. Kitayutasresearch, role
Shuseki Kingdom is the world's leading nation for innovation and technology. there are n cities in the kingdom, numbered from 1 to n. thanks to Mr. kitayuta's research, it has finally become possible to construct teleportation pipes betwe
Shuseki Kingdom is the world's leading nation for innovation and technology. There areNCities in the kingdom, numbered from 1N.
Thanks to Mr. Sort's research, it has finally become possible to construct teleportation pipes between two cities. A teleportation pipe will connect two cities unidirectionally, that is, a teleportation pipe from cityXTo cityYCannot be used to travel from cityYTo cityX. The transportation within each city is extremely developed, therefore if a pipe from cityXTo cityYAnd a pipe from cityYTo cityZAre both constructed, people will be able to travel from cityXTo cityZInstantly.
Mr. Kitayuta is also involved in national politics. He considers that the transportation betweenMPairs of city (AI,?BI) (1? ≤?I? ≤?M) Is important. He is planning to construct teleportation pipes so that for each important pair (AI,?BI), It will be possible to travel from cityAITo cityBIBy using one or more teleportation pipes (but not necessarily from cityBITo cityAI). Find the minimum number of teleportation pipes that need to be constructed. So far, no teleportation pipe has been constructed, and there is no other valid tive transportation between cities.