The number of elements equal to the maximum

The number of elements equal to the maximum. A sequence consists of integer numbers and ends with the number 0. Determine how many elements in this sequence are equal to its largest element.

Test Case Input (Sequence) Expected Output
1 1
2
3
0
1
2 4
4
4
0
3
3 7
3
7
7
0
3