#include <iostream>
int main()
{
// currVal is the number we're counting; we'll read new values into val
int currVal = 0, val = 0;
// read first number and ensure that we have data to process
if (std::cin >> currVal)
{
int cnt = 1; // store the count for the current value we're processing
while (std::cin >> val) // read the remaining numbers
{
if (val == currVal) // if the values are the same
++cnt; // add 1 to cnt
else // otherwise, print the count for the previous value
{
std::cout << currVal << " occurs "
<< cnt << " times" << std::endl;
currVal = val; // remember the new value
cnt = 1; // reset the counter
}
} // while loop ends here
// remember to print the count for the last value in the file
std::cout << currVal << " occurs "
<< cnt << " times" << std::endl;
} // outermost if statement ends here
}
I2luY2x1ZGUgPGlvc3RyZWFtPgppbnQgbWFpbigpCnsKLy8gY3VyclZhbCBpcyB0aGUgbnVtYmVyIHdlJ3JlIGNvdW50aW5nOyB3ZSdsbCByZWFkIG5ldyB2YWx1ZXMgaW50byB2YWwKICAgIGludCBjdXJyVmFsID0gMCwgdmFsID0gMDsKLy8gcmVhZCBmaXJzdCBudW1iZXIgYW5kIGVuc3VyZSB0aGF0IHdlIGhhdmUgZGF0YSB0byBwcm9jZXNzCiAgICBpZiAoc3RkOjpjaW4gPj4gY3VyclZhbCkKICAgIHsKICAgICAgICBpbnQgY250ID0gMTsgLy8gc3RvcmUgdGhlIGNvdW50IGZvciB0aGUgY3VycmVudCB2YWx1ZSB3ZSdyZSBwcm9jZXNzaW5nCiAgICAgICAgd2hpbGUgKHN0ZDo6Y2luID4+IHZhbCkgICAvLyByZWFkIHRoZSByZW1haW5pbmcgbnVtYmVycwogICAgICAgIHsKICAgICAgICAgICAgaWYgKHZhbCA9PSBjdXJyVmFsKSAvLyBpZiB0aGUgdmFsdWVzIGFyZSB0aGUgc2FtZQogICAgICAgICAgICAgICAgKytjbnQ7IC8vIGFkZCAxIHRvIGNudAogICAgICAgICAgICBlbHNlICAgLy8gb3RoZXJ3aXNlLCBwcmludCB0aGUgY291bnQgZm9yIHRoZSBwcmV2aW91cyB2YWx1ZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBzd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