from re import match
s = 0
try:
    while True:
        line = input()
        m = match(r"(?:(\d+),-)?(\|*)", line)
        if m[1] is None:
            p = 42
        else:
            p = int(m[1])
        n = max(1, len(m[2]))
        s += p * n
except EOFError:
    s = (s // 10) * 10 if s % 10 < 5 else (s // 10 + 1) * 10
    print(str(s) + ",-")
