#include<fstream.h> ifstream f("date.in"); void main() { long x,y,n; f>>x; n=1; while(f>>y) { if(x==y) n++; else { cout<<x<<" "<<n<<" "; n=1; } x=y; } cout<<x<<" "<<n; }