import sys,re

p=re.compile('\d+')

x=[]

for s in sys.stdin:

    x+=p.findall(s)

print(sum(map(int,x)))
import sys,re

s="".join([s for s in sys.stdin])

p=re.compile('\d+')

x=p.findall(s)

print(sum(map(int,x)))
import sys, re

p = re.compile("\d+")
x = []
for s in sys.stdin:
    x += p.findall(s)
print(sum(map(int, x)))

import sys, re

s = "".join([s for s in sys.stdin])
p = re.compile("\d+")
x = p.findall(s)
print(sum(map(int, x)))

+s = "".join([s for s in sys.stdin]) -x = [] -for s in sys.stdin: -    x += p.findall(s) +x = p.findall(s)