#include <iostream> using namespace std; int main() { char str = 0, P = 0; int cnt = 0; while(cin >> str) { if(str != P || str == EOF) { if(cnt) cout << cnt << P; P = str; cnt = 1; } else { cnt++; } } return 0; }