Shravani is a frugal person. She hates spending money on things, be it for her own good or bad. But this time her friends have caught up with her, and are demanding a huge birthday treat.
She figured out that there is no way for her to save herself and her money now. So, she decided to treat as many friends as she can. But, she still thought that she could skip inviting those friends who don't have any dependency. That is to say that, let's say that she has 'n' friends, and a friend A[i] wouldn't come to the party if A[j] is not invited. But, it's not necessary that the vice-versa is true.
Shravani wants to invite minimum number of friends to celebrate her birthday party to save money - help her figure out the minimum number of friends she can invite while fulfilling their demands. She cannot have a party without any friend, so she has to take one friend with her, at least to celebrate her birthday, by the way.
Input Format
The first line will contain two integers, n and d, where n denotes the number of friends, while d denotes the number of dependency relations. The next d lines will contain two integers, a and b - which would represent that friend a wouldn't come to the party until and unless friend b is also invited.
Constraints
1 <= n <= 1000 1 <= d <= 1000 1 <= a, b <= n
a is not equal to b.
Output Format
Print the minimal number - minimum number of friends Shravani can invite while handling the demands and celebrating her birthday still.