As a Valentine's Day surprise, you want to deliver chocolate to all of your friends. You have $$$N$$$ friends, each living in their own house labeled from $$$1$$$ to $$$N$$$. There are a series of $$$M$$$ one-way roads which connect houses together.
Unfortunately, it is storming heavily outside, so you resort to driving on the one-way roads instead of walking. Assuming you can start at any friend's house and can traverse through roads/houses more than once, what is the maximum number of unique friends you can deliver chocolate to?
The first line of input contains the integers $$$N$$$ and $$$M (1 \leq N \leq 10^3, 1 \leq M \leq 2N)$$$.
The next $$$M$$$ lines contain two integers $$$A$$$ and $$$B$$$, indicating that there is a one-way road pointing from house $$$A$$$ to house $$$B$$$. $$$(A \neq B, 1 \leq A, B \leq N)$$$
Please output an integer $$$K$$$, the maximum number of houses you can visit.
3 2 1 2 2 3
3
3 1 1 2
2
5 5 3 5 3 2 2 3 4 5 5 1
4