Telephone numbers - Codesize - Puzzle discussion

Feel free to send your feedback or ask some help here!

Telephone numbers - Codesize

A validator is missing in the test suite. That is when one of the phone numbers is equal to the number N of telephone numbers. Otherwise the first line can be ignored in certain codes.
For example:

3
1
2
3

should return 3.