S = input() A = ['1','2','3','4','5','6','7','8','9'] x = 0 for n in A: p = S.count(n) x = x + (p * int(n)) if x == 0: print('()') else: print(x)