@staticmethod
def b():
    s = (sys.stdin.readline().rstrip() + '$')
    cnt = 0
    prev = '$'
    t = ''
    for c in s:
        if (c == prev):
            cnt += 1
            continue
        t += (prev + str(cnt))
        prev = c
        cnt = 1
    print(t[2:])
@staticmethod
def b():
    s = (sys.stdin.readline().rstrip() + '$')
    cnt = 0
    prev = '$'
    t = 
    for c in s:
        if (c == prev):
            cnt += 1
            continue
        t += (prev + str(cnt))
        prev = c
        cnt = 1
    print(t[2:])