{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"N (1 \u0026lt;\u003d N \u0026lt;\u003d 100) cows, conveniently numbered 1..N, are participating\n\u003cbr\u003e\n in a programming contest. As we all know, some cows code better\n\u003cbr\u003e\n than others. Each cow has a certain constant skill rating that is\n\u003cbr\u003e\n unique among the competitors.\n\u003cbr\u003e\n\u003cbr\u003e\n The contest is conducted in several head-to-head rounds, each between\n\u003cbr\u003e\n two cows. If cow A has a greater skill level than cow B (1 \u0026lt;\u003d A \u0026lt;\u003d\n\u003cbr\u003e\n N; 1 \u0026lt;\u003d B \u0026lt;\u003d N; A !\u003d B), then cow A will always beat cow B.\n\u003cbr\u003e\n\u003cbr\u003e\n Farmer John is trying to rank the cows by skill level. Given a list\n\u003cbr\u003e\n the results of M (1 \u0026lt;\u003d M \u0026lt;\u003d 4,500) two-cow rounds, determine the\n\u003cbr\u003e\n number of cows whose ranks can be precisely determined from the\n\u003cbr\u003e\n results. It is guaranteed that the results of the rounds will not\n\u003cbr\u003e\n be contradictory.\n\u003cbr\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cbr\u003e\n * Line 1: Two space-separated integers: N and M\n\u003cbr\u003e\n\u003cbr\u003e\n * Lines 2..M+1: Each line contains two space-separated integers that\n\u003cbr\u003e\n describe the competitors and results (the first integer, A, is\n\u003cbr\u003e\n the winner) of a single round of competition: A and B\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"* Line 1: A single integer representing the number of cows whose ranks\n\u003cbr\u003e\n can be determined\n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e5 5\r\n4 3\r\n4 2\r\n3 2\r\n1 2\r\n2 5\r\n\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003e2\u003c/pre\u003e"}}]}