Time limit
2s
Memory limit
128 MB
Logic professor Yang Hangseung wrote N statements on a board. Each statement has the following form:
The integer x may be different for each statement. For every statement, the input gives the integer x appearing in that statement.
Given all N statements, determine how many of them are true.
The first line contains N, the number of statements Yang Hangseung wrote. N is a natural number between 1 and 50, inclusive.
The second line contains the N nonnegative integers written in the statements. Each integer is at most 50.
Print the number of true statements among the written statements.
If the statements are contradictory, print -1. If more than one answer is possible, print the largest possible answer.