# encoding=utf-8
import sys
s = sys.stdin.readline().strip("\n")
if len(s)==1:
print str(1)+s
exit(0)
res = ""
count = 1
for i in range(len(s) - 1):
if s[i] == s[i + 1]:
count += 1
else:
res += str(count)+s[i]
count=1
pass
if s[-2]==s[-1]:
res+=str(count)+s[-2]
else:
res+=str(1)+s[-1]
print res