string = str(input())

def strip(s):
    list1 = s.split("\n")
    total = 0
    for i in range(0,len(list1)-1):
        list2 = list1[i].split('|')
        total += int(list2[3].replace(",",""))

    print(total)

strip(string)
