-1 Terminated Program

Write a program that reads a negative-terminated sequence of non-negative numbers and then outputs the number of times that the last number in the sequence occurred.

Sample Solution