#include <bits/stdc++.h>
using namespace std;

string collapseInput(string s) {
    // If string is empty
    if (s.empty()) {
        return "";
    }

    string result = "";
    int count = 1;

    for (int i = 1; i < s.length(); i++) {
        if (s[i] == s[i - 1]) {
            count++;
        } else {
            // Append count and character
            result += to_string(count);
            result += s[i - 1];

            // Reset count
            count = 1;
        }
    }

    // Add last group
    result += to_string(count);
    result += s[s.length() - 1];

    return result;
}

int main() {
    string s;
    cin >> s;

    cout << collapseInput(s);

    return 0;
}