import re

reg = re.compile(r'((\d+),-)?(\|*)')
s = 0

line = input()
while line:
    res = reg.fullmatch(line)

    price = int(res.group(2)) if res.group(1) else 42

    s += price * max(1, len(res.group(3)))

    try:
        line = input()
    except Exception:
        break

print(f'{((s+9)//10)*10},-', flush=True)

