line = input()
last = None
counter = 0
for ch in line:
if ch != last:
if last is not None:
print(counter, end='')
counter = 1
last = ch
print(ch, end='')
else:
counter += 1
if last is not None:
print(counter, end='')