line = "" price = 0 while True: try: line = input() except: break if line[0] == '|': price += 42 * len(line) else: numstr = '' for char in line: if char == ',': break else: numstr += char p2 = int(numstr) bars = 0 for char in line: if char == '|': bars += 1 if bars == 0: price += p2 else: price += p2 * bars if price % 10 < 5: print(price - price % 10, end = '') else: print(price + 10 - price % 10, end = '') print(",-")