d = 0
try:
    while g := list(filter(str.isdigit, input())):
        d += int(g[0] + g[-1])
except:
    print(d)