a = input()
if len(a) == 1:
    print(f'1{a}')
b = ''
j = 1
for i in range(1, len(a)):
    if a[i] == a[i-1]:
        j += 1
    else:
        b += f'{j}{a[i-1]}'
        j = 1
    if i == len(a) - 1:
        b += f'{j}{a[i]}'
print(b)