The problem's input has several cases. Each test case begins with a line with two nonnegative integer numbers, i (0 < i ≤ 20) and a (0 ≤ a ≤ 800), separated by blanks. i is the number of informants and a is the number of answers in the confidence survey. Then, a lines follow, each one with two integer numbers x and y (1 ≤ x ≤ i, 1 ≤ |y| ≤ i), separated by blanks. If y is positive, the input line means that "informant x says informant y is reliable". If y is negative, the then the line means that "informant x says informant y is not reliable". The end of the input is indicated by a line with two 0 values (an artificial case that should be ignored).
For each input case, output in a single line the corresponding answer, i.e., the maximum number of reliable informants according to the answers in the survey.