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