s = str(input())

num_moto = int(len(s))

while True:
    if ( s.find('10') == -1 and s.find('01') == -1 ) or int(len(s)) == 0:
        break
    s = s.replace('10','')
    s = s.replace('01','')
print(s)
num_kekka = int(len(s))
print(num_moto - num_kekka)