# Note - this code must run in Python 2.x and you must download
# http://www.pythonlearn.com/code/BeautifulSoup.py
# Into the same folder as this program

import urllib
from BeautifulSoup import *

url = raw_input('Enter - ')
html = urllib.urlopen(url).read()

soup = BeautifulSoup(html)

# Retrieve all of the anchor tags
tags = soup('span')
nums = list()

for tag in tags:
    for line in tag:
        line = line.rstrip()
        enums = re.findall('[0-9]+', line)
        if len(enums) == 0 : continue
        for n in range(len(enums)):
            num = int(enums[n])
            nums.append(num)
    # Look at the parts of a tag
    #print 'TAG:',tag
print(sum(nums))
    #print 'URL:',tag.get('href', None)
    #print 'Contents:',tag.contents[0]
    #print 'Attrs:',tag.attrs
