#include <iostream>
#include <string> // It's good practice to include string and to_string

using namespace std;

int main() {
    string s;
    cin >> s;
    
    // Handle empty string edge case
    if (s.empty()) {
        return 0;
    }

    string ans = "";
    ans += s[0];
    int cnt = 1;
    
    for (int i = 1; i < s.size(); i++) {
        if (s[i] == s[i - 1]) {
            // If current char is the same as the previous, just increase count
            cnt++;
        } else {
            // If it's different, append the previous count, then the new char
            ans += to_string(cnt);
            ans += s[i];
            cnt = 1; // Reset count for the new character
        }
    }
    
    // Don't forget to append the count of the very last character sequence!
    ans += to_string(cnt);

    cout << ans << endl;
    return 0;
}